An important part of a support system is the ability to "time out" issues that have been awaiting a customer response for more than a certain period.
On https://support.atlassian.com, we do this in two phases:
- If an issue in status Waiting for Customer goes unanswered for 7 days, it is moved to status "Inactive - Pending Closure".
- After another 7 days, it is moved to status Closed.

Each transition triggers an email notification to remind the customer, should they wish to respond.
Implementation
Automatic status transitions can be implemented in JIRA with a saved search (aka. filter), Jelly script, and a Jelly service.
We create a filter returning issues that ought to be transitioned, and then create a Jelly script which loops over these issues and transitions them. The Jelly script is then run once a minute via the Jelly service.
Set up the filter
- Create an automaticservices group.
- Create a user to perform the transitions. Customers will receive emails with this user's name as the sender, so choose something generic. We went with "Atlassian Support" (username atlassiansupport).
- Add your user to the automaticservices group.
- In your permission scheme, grant automaticservices the Browse Projects, Resolve Issues, Close Issues and Add Comments permissions.
- Log in as your user (henceforth atlassiansupport).
- Search for issues in all support projects:

in status Waiting for Customer:

that have been updated from (unspecified) to 1 week ago:

- Save this search as a filter, called something descriptive like "To be inactivated - no response for a week".

Create the Jelly script
Save the support-inactivate.xml Jelly script to your filesystem. Its contents is as follows:
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" > <jira:Login username="atlassiansupport" password="[your password]"> <log:info>Running Inactivate issues service</log:info> <!-- Properties for the script --> <core:set var="comment">This issue has not been updated for 5 business days. If you have an update, please use "Add Comments For Atlassian" action to let us know. If you need more time to gather information please let us know and we will 'freeze' this issue. If you have no other questions, please Close this issue. If no update is received in the next 5 business days, this issue will be automatically closed. Thank you, The Atlassian Support Team</core:set> <core:set var="workflowStep" value="Mark Inactive" /> <core:set var="workflowUser" value="atlassiansupport" /> <core:set var="filter7Days" value="11505" /> <!-- Run the SearchRequestFilter --> <jira:RunSearchRequest filterid="${filter7Days}" var="issues" /> <core:forEach var="issue" items="${issues}"> <log:info>Inactivating issue ${issue.key}</log:info> <jira:TransitionWorkflow key="${issue.key}" user="${workflowUser}" workflowAction="${workflowStep}" comment="${comment}"/> </core:forEach> </jira:Login> </JiraJelly>
This script runs a filter, and stores the returned issue list as the issues variable. The <core:forEach> tag then loops over these issues (setting the issue variable to the current one). It then does a workflow transition on each issue.
The script needs to be customized for your use:
- Replace [JIRA:your password] with the password you set for the atlassiansupport user.
- Customize the comment text for your organization. This text will be seen on the issue and in the notification email sent to customers.
- Figure out the internal ID of the filter you saved, and set the filter7Days variable to it. The filter ID can be seen in the URL when the filter is loaded, eg. in the JIRA:screenshot above.
- If you are not using the Atlassian Support workflow, you will need to customize the workflowStep variable too.
Run the script as a service
Log into JIRA as an administrator. Go to Administration → Services and add a Jelly service:

Now edit the new Jelly service. For Input File, specify an absolute path on the server's filesystem to the Jelly script:

The Output File can be created anywhere the JIRA user has write permission.
Customize log output
It is useful to see logs of what the Jelly script is doing. You can enable the <log:info> tag logging by editing WEB-INF/classes/log4j.properties, and adding the lines:
log4j.category.org.apache.commons.jelly.tags.log.InfoTag = INFO, console, filelog log4j.additivity.org.apache.commons.jelly.tags.log.InfoTag = false
See Changing JIRA's log output for more details. Once configured, you should see logs like:
2007-12-19 02:44:53,440 INFO [jelly.tags.log.InfoTag]() Running Inactivate issues service 2007-12-19 02:44:53,852 INFO [jelly.tags.log.InfoTag]() Inactivating issue CSP-13938 2007-12-19 02:44:53,852 INFO [jelly.tags.log.InfoTag]() Inactivating issue CSP-13934
Closing Inactive issues
The above process needs to be repeated to set up the support-closeinactive.xml script. The filter we use in conjunction with support-closeinactive.xml is:

