As an administrator, being able to automate tasks is often a very important task. Earlier, you often needed to have some programming skills in order to take advantage of some of the automation facilities provided by JIRA such as Listeners and Services. Luckily, Atlassian now provides a tool to help with automation without the need to know any programming.
In this recipe, we will set up an automated task, where JIRA will periodically check for issues that have not been updated in seven days, close them, and add a comment.
For this recipe, we need to have the JIRA Automation Plugin add-on installed. You can download it from the following link and install it using the UPM:
https://marketplace.atlassian.com/plugins/com.atlassian.plugin.automation.jira-automation-plugin
Perform the following steps to set up an automated task:
0 0 0 * * ?
.project = "Help Desk" AND updated <= -7d
. This will get us the list of issues in the Help Desk project that have not been updated in the last seven days.An automation rule consists of two components, the trigger and the action. The trigger will cause the task to happen. The two built-in triggers are as follows:
An action is what will happen when a trigger is fired. A trigger can fire more than one action. The five built-in actions are as follows:
With our automation task, we have set up a trigger to run every day at midnight with the 0 0 0 * * ?
CRON expression. We then used a JQL query to select only the issues in the Help Desk project that have not been updated in the last seven days at the time when the task was run.
We then added two actions for the trigger, one to transition all the issues returned from the JQL query to Done, and another to add a comment, which will also send out a notification.