Documentation for JIRA 6.4 EAP. Not using this? See below:
(JIRA 6.3.x documentation | JIRA Cloud documentation | earlier versions of JIRA)

Skip to end of metadata
Go to start of metadata

Below are the two Jelly scripts used by Atlassian's support system to automatically close issues after a certain period. These Jelly scripts are then run with the built in Jelly Service.

 Make an issue inactive

Close an issue

For more helpings of Jelly, see Jelly Examples​.

28 Comments

  1. 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

    Rgds
    V.

    1. Hi Vincent,

      Am new to JIRA 4.1.I can't get you the details in the above link.

      If you don't mind, could you please explain the steps in detail?

      Thanks

      1. Hi Saran,

        Kaamelot Plugin is no more supported, and has been replaced by Minyaa.

        For Auto-Transition, see documentation here

        Activity Condition are described here.

        Make a try.

        Vincent

        1. Thanks for your valuable input Vincent.

        2. Hi Vincent,

          When I try to create new Service in JIRA 4.1 by giving this class name "com.atlassian.jira.service.AutoTransitionService"

          Its showing the following error

          Class [com.atlassian.jira.service.AutoTransitionService] was not found. Ensure that you have typed it correctly and it is in the classpath.

          Please suggest.

          1. Hi Saran,

            I suppose that yo have installed Minyaa!

            Can you open an issue on http://www.minyaa.com/jira and provide more details (How you process the installation and log files)

            Regards

            Vincent

    2. Can someone from Atlassian remove this entire thread as it refers to broken links and JIRA versions that are not supported anymore. It would spare users the time of reading useless stuff.

  2. 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
    1. Anonymous

      Hi,

      Is this something that If I add to our JIRA system would enable us to apply to our workflows?

      or it would apply to all the issues in the system?

      thanks

      Gill

  3. 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. 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

  5. This Jelly script escalate issue to project lead in this case:

    • Last comment from assignee or project lead was N days ago
    • Assigne is not project lead
    • Reporter is not in Project role (WorkflowStaff)
  6. Hi,

    I added a custom field Root Cause (required) to my resolution screen and now my jelly script is throwing error on TransitionWorkflow.

    It happens even if the root cause has already been specified by users at earlier stage of the workflow.

    I searched for docs. related to TransitionWorkflow but looks like it doesn't has a parameter to set custom field:http://confluence.atlassian.com/display/JIRA/Jelly+Examples

    This is what I want:
    If root cause has already been specified, stay that way. If not, update it to the option "No Response".

    How does one set/reference custom field in TransitionWorkflow?

    Thanks.

    1. Hi Royce,

      I have resolved such problem by extending the TransitionWorkflow tag.

      See http://www.minyaa.com/documentation/latest/Features/ModuleTools/JellyTags.html#TransitionWorkflowExtended%20Tag

      Regards

      Vincent

      1. Thanks Vincent! Nice set of tools. I will check out the extended TransitionWorkflow tag..

  7. I have this condition in my workflow:

    All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.

    Naturally, I encountered errors with my jelly script when it tried to close a parent task with one or more non-closed sub-tasks.

    <jira:TransitionWorkflow> Found workflow transition with name/id 'Inactive - Pending Closure' but that is not a valid
     workflow transition for the current state of issue 'ABC-23'.
            at com.atlassian.jira.jelly.tag.issue.TransitionWorkflow.getActionByName(TransitionWorkflow.java:437)
            at com.atlassian.jira.jelly.tag.issue.TransitionWorkflow.getActionId(TransitionWorkflow.java:161)
    
    bla... bla... bla...
    

    My question is, how can I catch that exception in jelly script? Which tag\s should I use around jira:TransitionWorkflow? I would like to output my own message instead of errors messages shown above. Thanks in advance.

  8. Reply to my own question:

    Tried several other ways but this works.

    Reference: http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/catch.html

  9. I am trying to transition from a state to state based on the fields. I don't find any particular example for this. Please anyone can help me with this. 

     

    Also I don't see how are we getting the filter id's in numbers "11509" etc. Can anyone give a link how to do this ?

     

    Thanks,

    Anum

    1. Click on the filter. The issues are suppossed to be filtered. Then have a look into the URL. there is the ID with numbers.

  10. Anonymous

    I'm wondering why there are passwords in plain text in the Jelly service.  Seems to be a big security flaw.  Can't the Jelly Service always run as a specific user without needing to put in a plaintext username and password?

  11. Joe

    Is there a way I can turn off Notification Emails while say Deleting Cases from a Jelly script. I don't want the reporters/watchers to be spammed with thousands of emails. 

     

  12. Is there a way to create issues on a specific date or lets say every other Monday using Jelly script?

    Thanks for your help.

    Anand

  13. Hi,

    Can I do a transition on subtasks ?

    My search filter returns a list of subtasks, but nothing happens whe the service runs.

    I have tested my jelly script on 'Jelly Runner' and again nothing happens.

    Any advise will be appreciate,

    Thanks

    1. Actually I had to setup the permission 'Browse Project' to user who will make the transition (and will make the query) defined in the jelly script, as below:

      When I did that all worked fine!

  14. Can i get a jelly script to make user accounts in active?

  15. Hi All,

    About Closure script what is " <core:set var="filter7Days" value="11509" />"

    Is it a custom field, a filter, another thing?

     

    Thank you

    1. I find the answer.

  16. Concerning the inactive script above, does this execute the post functions associated with the transition?