Jelly Escalation

JIRA Documentation

Index

Below are the 2 jelly scripts used by Jira's support system to automatically close issue after a certain period. These jelly scripts are then run with the built in Jelly Service.

 Make an issue inactive

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" >
<jira:Login username="atlassiansupport" password="[your password]">
    <log:warn>Running Inactivate issues service</log:warn>
    <!-- Properties for the script -->
    <core:set var="comment">This issue has not been updated for 5 business days.
    
If you have an update, please use "Add Comments For Atlassian" action to let us know. If you need more time to gather information please let us know and we will 'freeze' this issue. If you have no other questions, please Close this issue.
    
If no update is received in the next 5 business days, this issue will be automatically closed.
    
Thank you,
    
  The Atlassian Support Team</core:set>
    <core:set var="workflowStep" value="Mark Inactive" />
    <core:set var="workflowUser" value="atlassiansupport" />
    <core:set var="filter7Days" value="11505" />
    
    <!-- Run the SearchRequestFilter -->
    <jira:RunSearchRequest filterid="${filter7Days}" var="issues" />

    <core:forEach var="issue" items="${issues}">
        <log:warn>Inactivating issue ${issue.key}</log:warn>
        <jira:TransitionWorkflow key="${issue.key}" user="${workflowUser}" workflowAction="${workflowStep}" comment="${comment}"/>
    </core:forEach>
</jira:Login>
</JiraJelly>

Close an issue

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" >
<jira:Login username="atlassiansupport" password="[your password]">
    <log:info>Running Close issues service</log:info>
    <!-- Properties for the script -->
    <core:set var="comment">This issue has not been updated for 10 business days and will be Closed.
    
If this issue has not been completed please reopen this issue and we will do our best to help you as soon as we can.
    
Thank you,
    
  The Atlassian Support Team</core:set>
    <core:set var="workflowStep" value="711" />
    <core:set var="workflowUser" value="atlassiansupport" />
    <core:set var="filter7Days" value="11509" />

    <!-- Run the SearchRequestFilter -->
    <jira:RunSearchRequest filterid="${filter7Days}" var="issues" />
    
    <!-- Iterate over the issues -->
    <core:forEach var="issue" items="${issues}">
        <log:warn>Closing inactive issue ${issue.key}</log:warn>
        <jira:TransitionWorkflow key="${issue.key}" user="${workflowUser}" workflowAction="${workflowStep}" comment="${comment}" resolution="Customer Timeout"/>
    </core:forEach>
</jira:Login>
</JiraJelly>

For more helpings of Jelly, see Jelly Examples.

Labels:

jelly jelly Delete
support support Delete
administration administration Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Jul 31

    Vincent Thoulé says:

    Another way may be to implement an Auto Transition. Our users required an Auto C...

    Another way may be to implement an Auto Transition.
    Our users required an Auto Closure of old Support Issues.
    To do that, I implemented :

    The Transition's comment may be entered in Workflow Transition as follow

    <meta name="auto.transition.comment">This issue has not been updated for ...  The Atlassian Support Team</meta>

    Rgds
    V.

  2. Aug 14

    Mark Michaelis says:

    Wondering why it is not stated here... just wrote as comment on the page Jelly E...

    Wondering why it is not stated here... just wrote as comment on the page Jelly Examples how to add these escalation scripts to your JIRA system. Thought it might be a good idea to state this here, too:

    1. Administration
    2. System >> Services
    3. Add a service:
      1. Name My Escalation Task
      2. Built-in Services: Run Jelly script
      3. Delay: in minutes
      4. Press Add Service button
      5. Input File: The Jelly script to run. Must be located on the server.
      6. Output File: Can be empty.
      7. Delay: Hm, can be entered/altered here again.
      8. Press Update
  3. Aug 18

    amina says:

    Do I need these two scripts in order to close an issue after 8 days being inacti...

    Do I need these two scripts in order to close an issue after 8 days being inactive?

    If yes, how can I configure them do I need two services running?

    Thanks

  4. Aug 18

    amina says:

    I've found the solution I have to add the JIRA toolkit and add a custom field na...

    I've found the solution I have to add the JIRA toolkit and add a custom field named "resolved issues" this field appears in the filter menu and allow me specify the delay of my filter

    http://confluence.atlassian.com/display/JIRAEXT/JIRA+Toolkit

    Thanks