Hi all,
I'd like to create automation that updates an Epic's custom field based on a comparison of its child issues data.
Basically I'd like to achieve the following:
- When: An Epic is closed
- Then: It loops through the Epic's child issues and finds the latest resolution date
- And: Updates a custom field (e.g. 'End date') on the Epic with the latest resolution date of the previous step
The problem I'm facing is that variables created in automation routines in Jira don't have global scope, so a variable that is set within an if branch is not visible outside of it.
Does anyone have any ideas about how I could solve this problem?
Thank you in advance,
Tony
You don't necessarily need to use BRANCH if your trigger is a recognized Epic event.
See an alternative you can achieve to do this. Assume that I am using the Due date field as a reference, but in the end, you just change it to the field that makes sense to you
I'm using the Due Date field for the example, but you just need to change the field after ORDER BY for your date field. Use DESC to sort for the major to minor Date
In this case, you don't need the BRANCH because, as the Epic is the issue trigger for the Event, you only need to use the lookup feature to search for issues within the Epic itself.
If this doesn't work for you, share your rule details via images so we can help you achieve your goal.
Regards,
Fernando
Good suggestion, @Fernando Eugênio da Silva
You don't actually need to create a variable for the issue key of the Epic. Just use {{issue.key}} in the Lookup Issues JQL where you have {{epic}}.
Also note that if this is for a Team Managed project, in the JQL of the Lookup Issues action you need to use Parent rather than Epic Link.
I would also recommend adding a condition after the check that the trigger issue was an Epic to ensure that the Epic has child issues.
Or add a condition after the Lookup to ensure that the Lookup found issues:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That worked and it's clean. Thank you both, I appreciate the help! :)
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.