Hi,
This may not be a functionality that is possible but I want to check with others.
I have a numerical field on a Parent Epic that is used to keep track of the number of stories in the 'To Do' status category.
I want to create an automation that, on manual trigger, will check the status category of the stories, and if it falls into the 'To Do' status category to increase the value of the field on the Parent Epic.
So 6 stories in 'To Do' results in Parent Epic field = 6.
I know I can do this in code but not sure if this is possible in Jira Automation.
Hello @Drew McLean
Yes, this is possible with an Automation rule. Here is the rule:
1. Trigger: Manual
2. Use a Condition to confirm the rule was triggered on an Epic.
3. Use a Lookup Issue action to look for all child issues of that Epic where the child issue is a standard level issue type and its current status is within the "To Do" status category.
4. Edit the Epic to set your field to the count of issues found by the Lookup Issue action, or to zero if the action did not find any issues. (I used the Summary field but you would set your custom field.
Information about each of these functions can be found in the documentation.
https://support.atlassian.com/cloud-automation/docs/jira-cloud-automation/
@Trudy Claspill Thank you for this! I saw the lookup Issues action but was never really sure on how to implement it in this case. I tried this and it worked exactly as expected.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill one last question.
Say I want to repeat this action for more than one field. Can I reuse this in the same automation or do I have to create a separate rule for each?
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.
You can update multiple fields with the one result or have multiple Lookup Issues actions to update different fields.
Note that each Lookup Issues action overwrites the results of the previous use of the action. So you need to execute the Lookup Issues actions, then use the result before executing another Lookup Issues actions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Drew McLean
Adding to Trudy's answer...
For your scenario of wanting to count various things in the child issues, based on some criteria, it may be possible to do this with one single lookup issues call, smart value list filtering, and math functions. The advantage of this approach is it may be faster than calling lookup several times.
Here is the how-to on smart value, list filtering and a reference to math expressions if you want to try this: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588 and https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
With this you can use a math expression instead of the size of the resulting lookup. Perhaps like this for the issue count with a status category of "To Do":
{{#=}}0{{#lookupIssues}}{{#if(status.statusCategory.name.equals("In Progress"))}}+1{{/}}{{/}}{{/}}
How this works:
The same technique works to sum / count / average anything. (Although average takes a bit more work.)
Kind regards,
Bill
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.