Would it be possible to automate the linking of subtasks upon creation regardless of tickets created in out of order within one Jira project?
The expectation on the automation or scripting is to retrieve all the subtasks then sort by either creation date/time or issue key or any parameter that fits best under the parent issue and then looping through the results to link one subtask ticket to the immediate next one.
Hi @VVC
What you describe is not possible with automation rules using branches as they execute in parallel / asynchronously, and so one could not loop through them in a defined order. There are open suggestions to make the processing configurable, at least for Jira Cloud automation.
The only way I know to do this for an automation rule is to explicitly create the issues, one by one, adding the links as the rule proceeds, without branching.
Possible workarounds might be:
Kind regards,
Bill
One possible solution is to create the link as the subtasks are created, using an Automation rule.
Trigger: issue created
Condition: Issue type is sub-task
Action: Lookup Issues
Use a JQL to find all the subtasks under the same parent, excluding the current subtask, and order by the parameter you choose so that "last" one to which you would want to link the new subtask would be at the top of the list
key != {{triggerIssue.key}} and parent={{triggerIssue.parent.key}} order by created desc
Action: Edit Issue
Edit the newly created subtask. Add the Linked Issues field. Choose your link type (i.e. depends on). To link to the issue that appears first in the list of issues returned by the Lookup enter the smart value {{lookupIssues.first.key}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Trudy Claspill . I will implement your automation solution and let you know how it works out for our scenario.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After internal review, it looks like the linking of subtasks between predecessor and successor is completely random and non-sequential order. At times, a predecessor subtask is linked to multiple subtasks and also, there may be a scenario where the last subtask is linked to parent/main issue.
In view of this, I have proposed for linking the subtasks with a specific link type irrespective of whatever the order and count of subtasks for linkage. Also, another link type when linking subtask to the main issue. Using my automation rule, the successor subtask assignee has been notified when a predecessor subtask is set to DONE.
Besides the above, if the user forgets to link the subtasks after creation, a remainder notification alert goes out to the assignee of current subtask assignee too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.
Learn moreOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.