Auto close jira tickets with status "resolved"

Hello ladies and gents - I need to be able to auto close the tickets in "REOLVED" status within 24 hours. I was found this solution https://confluence.atlassian.com/display/JIRA/Jelly+Escalation - my script below

 

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log">
<jira:Login username="USER" password="PASSWORD">
<log:info>Running Close issues service</log:info>
<!--  Properties for the script  -->
<core:set var="comment">
resolved-slove
</core:set>
<core:set var="workflowStep" value="RESOLVED"/>
<core:set var="workflowUser" value="user name - who make comment"/>
<core:set var="search filer name" value="search filer ID"/>
<!--  Run the SearchRequestFilter  -->
a
<jira:RunSearchRequest filterid="${auto_close}" 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>

But when i start it in jelly runner console i'l get this exception

Exception: org.xml.sax.SAXException: could not find namespace with prefix core
java.io.PrintWriter@fc2bcb5

Please give me some advice about my problem
JIRA 6.3.14

LInux standalone instance

4 answers

JIRA Automation plugin replaced all our Jelly scripts. Would highly recommend staying away from Jelly for future compatibility

0 votes

I can't see where you set $autoclose ?

Sorry - but what for i should put $autoclose ?

You need to set it to the ID of the filter you want to run to find the issues. At the moment, you're not setting it in your script, and I think that might be causing a parse error (Sorry, I wrote $autoclose, it's actually $auto_close in your script)

If $autoclose - it is the name of search filer - then it is in my script <core:set var="search filer name" value="search filer ID"/>

Er, no, that's setting a variable that you never use in the script. Also, you need to use the ID of the filter, not the name.

p.s. Andrei's point is an excellent one...

0 votes
Joe Pitt Community Champion Feb 03, 2015

If you're going to autoclose them why not just change the workflow so resolving them closes them? Seems like a lot less work. If the 24 hours is to allow folks to check them for correctness it isn't really a realistic time frame in my experience. You could allow them to reopen if they say it was resolved incorrectly.

Don´t use a JellyScript - the JellyRunner won´t be included in the next JIRA version. Use the escalation service from ScriptRunner or The Scheduler Plugin...

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

27,024 views 2 7
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