Jelly script for Auto close a tikcet

VenugopalY January 3, 2013

Hi,

Some one can help me to configure a jelly script for Auto close tickets that have been resolved after 30 days with email notification to reporter.

Venu

1 answer

2 votes
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 3, 2013
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 3, 2013

create a filter to query issues that were resolved 30days before

i.e.

project in (ProjectA, ProjectB) AND status = Resolved AND resolutiondate >= -30d

this should be it...but check it in the issue navigator before and see if the result is ok

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 3, 2013

of course.

i edited my answer. the link shows a kb article with two jelly scripts atlassian uses.

on what point exactly you need help?

but to start with you should create a filter first that shows all the issues you are planning to close due to your 30 days timeout

VenugopalY January 3, 2013

I am new to this jelly script. Can you please specify step by step to achive this?

Thanks.

VenugopalY January 6, 2013

Hi Faysal,

Thanks for help.

I created filter which shows all the resolved isses more than 30 days.

Herequired to start with Jelly script. How do i proceed? how to use this filter for auto close an issue?

what is file extension for jelly script.

Basic script options? How do i specify the value in the code? how to validate jelly script?(through jelly runner?) how to add this to service? and other importanet parameters which need attention? etc...

Finally how to sent email notificatiuon about issue close information?

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

how to use this filter for auto close an issue?

find out what the id of that filter is...you will need to put it in the script

what is file extension for jelly script.

i don't know if there is any restriction...i used xml

start by copy&paste the "close" sample from the jelly escalation kb article

edit at least these lines

<jira:Login username="atlassiansupport" password="[your password]"> <- change username & password to the user who should be used for this action
..
..
<core:set var="workflowStep" value="711" /> <- change the value to the matching actionID
<core:set var="workflowUser" value="atlassiansupport" /> <- change the value to the username who will be used for this action
<core:set var="filter7Days" value="11509" /> <- change the value to your filterID
the emails will be sent using notification scheme...check who recieves emails about updating closing commenting etc....
finally create a service and use
com.atlassian.jira.jelly.service.JellyService (jelly must be enabled)
VenugopalY January 6, 2013

As per your suggestion i chaged values.

<core:set var="workflowStep" value="71" />
<core:set var="workflowUser" value="vyadav" />
<core:set var="filter10Days" value="10201" />

Am getting below error message when i run at Jelly Runner to validate script. any idea?

Error: <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log">
Exception: org.apache.commons.jelly.JellyTagException: null:17:0: Found workflow transition with name/id '71' but that is not a valid workflow transition for the current state of issue 'KENAI-39'.
java.io.PrintWriter@6a10ada0

From Resolved to Closed there is a conditon that only reporter can do this transistion. Not sure if this is causing issue?

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013
Could be the peoblem. Try creating a hidden transition and use this
VenugopalY January 7, 2013

I tried with Hidden transition but no luck.

#Only the reporter of the issue can execute this transition.
#Add grouped condition | Delete

#— AND Add condition to group | Switch to OR

#Hide transition from the user (the transition can be triggered only programmatically or from a workflow function).
#Add grouped condition | Delete

One more thing my suspection is that existing tickets('KENAI-39') have old workflow at the time of create issue. if this is causing? how do handle this?

Richard Cross April 21, 2015

That Jelly Escalation link is no longer valid as the page has been removed.

Suggest an answer

Log in or Sign up to answer