Jelly script for Auto close a tikcet

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

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

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

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

Thanks.

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?

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)

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?

Could be the peoblem. Try creating a hidden transition and use this

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?

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

128 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you