Hi,
Can anybody please help me in writing the jelly script/ or any other method for closing only resolved tickets which are older than 7 days. I have got the following info
http://confluence.atlassian.com/display/JIRA/Jelly+Escalation
But this seesm to be for closing all incative tickets. I don't want that to happen in my environment. I want a script which can be run as a service from JIRA which closes only the tickets which has a status as "Resolved" and which are older than 7 days.
I think I found the solution myself. For future reference. Here is what we have to do.
Create a user which is part of all of your groups as "jira-housekeeper".
Search issues which are in resolved state and more than 7 days old in JIRA for a project. Save the result as a filter. Find the filter id (by viewing the page source where you have the saved filters and by searching for "filterId") .
and use the following script.
=======================================
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" >
<jira:Login username="jira-housekeeper" password="88888">
<log:warn>Running Close issues service</log:warn>
<!-- 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.
Thank you,
DQA TEam</core:set>
<core:set var="workflowStep" value="Close Issue" />
<core:set var="workflowUser" value="jira-housekeeper" />
<!-- Run the SearchRequestFilter -->
<jira:RunSearchRequest filterid="11571" var="issues" />
<core:forEach var="issue" items="${issues}">
<jira:TransitionWorkflow key="${issue.key}" user="${workflowUser}" comment="${comment}" workflowAction="${workflowStep}"/>
</core:forEach>
</jira:Login>
</JiraJelly>
============================================
How to for running this script from JIRA.
To run a Jelly script once:
To run a Jelly script periodically:
Configure a service with the following class: <tt>com.atlassian.jira.jelly.service.JellyService</tt>.
Hi I treid and its works for me. Thank you verymuch. This meets our requirements.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sure I answered this somewhere on answers but can't find it. So here is a small paste from a script I have used before
<jira:Login username="USERNAME" password="PASSWORD">
<!-- Value below is the filter id -->
<core:set var="insufficientInformationNotRespondedFilter" value="10571" />
<!-- Run the SearchRequestFilter -->
<jira:RunSearchRequest filterid="${FILTER_WHICH_DETERMINES_WHAT_ISSUES_TO_CLOSE}" var="issues" />
<core:forEach var="issue" items="${issues}">
<core:set var="workflowStep" value="51" /> <!-- Closed due to no response id -->
<core:set var="resolutionStep" value="5" /> <!-- Resolution id -->
<log:warn>Closing inactive issue ${issue.key}</log:warn>
<jira:TransitionWorkflow key="${issue.key}" user="${issue.assignee}" assignee="${issue.assignee}" workflowAction="${workflowStep}" comment="${message}" resolution="${resolutionStep}"/>
</core:forEach>
</jira:Login>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All you need to do is change the filter and actions that "jelly escalation" uses. If you look at it closely, you'll see it works by saying "read filter X and do Y to all issues on it". Change the filter to one that says "resolved, last change more than 7 days ago" and the action to "close" and it'll do the job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.