Hi!
I would really appreciate it if someone could help me setup an automation to sum up Story points of work items to parent with the logical condition that the work item is not in status Done
I am using a company based project and I am using this smart value operation:
{{#lookupIssues}} {{#if(not(equals(status.statusCategory.name,"Done")))}} {{lookupIssues.Story Points.sum|0}} {{/}}
Thanks!
Hello @ahmed.moussa
Welcome to the Atlassian community.
To help you debug your automation we need additional information.
Please provide screen images that show your entire automation rule.
Please provide screen images showing the details of each step in the rule if the details are not all visible for the step in the diagram.
Please provide screen images showing all the details available in the audit log for an execution of the rule.
What is the result you are getting?
Thanks @Trudy Claspill !
The Story Points field does not update at all although the Audit log suggests that the automation was successful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
What are you trying to do with the second step in your rule?
Let me see if I understand your Requirement
For example if you have the following set of issues:
Epic-1
--- Child-1, status To Do
--- Child-2, status In Progress
--- Child-3, status Done
--- Child-4, status Done
If the Story points change on Child-4, you want to add up the story points for Child-1 and Child-2 only (because their statuses are not Done) and update Epic-1 with that value.
Is that correct?
If that is correct I recommend you simply the rule thus:
TRIGGER: keep this as is
FOR EACH: Parent
ACTION: Lookup Issues
JQL: parent = {{issue.key}} and status != Done
ACTION: Edit Work item
Field: Story Points
Value: {{lookupIssues.Story Points.sum|0}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see that in the image of your rule you used Rejected rather than Done. Make sure you change the JQL in my suggested solution accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! It seems to work as intended!
I don't understand how though :)
I would have guessed that the JQL would return the parent of the issue who's story points field was changed and who's status was not done?
parent = {{issue.key}} and status != Done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You didn't explain how you came to that conclusion, but I'll try to explain the logic of the JQL.
When you use "parent = X" you are telling Jira you want the issues whose parent is X.
When you are within a branch the context of {{issue}} changes. It no longer references the issue that triggered the automation. Instead it references the issue(s) being looped over by the branch. In this case because the branch is For Each Parent (of the trigger issue), within the branch {{issue}} references the parent of the trigger issue.
So, when story points change for Child-1 the branch begins a loop for the parent of Child-1; namely Epic-1.
Within the branch {{issue}} now references Epic-1. The JQL says to find issues where the Parent field equals Epic-1, meaning find the child issues of Epic-1, and additionally says to get only the child issues whose status is not Done.
Does that help clear things up?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...to the suggestions from @Trudy Claspill
Scenarios to sum / synchronize a field value between child and parent work items often require multiple rules to help. That is, a change to the Story Points field is not the only way the value can change. The keys are how often do you want the field updated and how accurately do you want the value updated?
To learn more cases where the value can be impacted, and what to do about it, please see this article I wrote on the topic:
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.
@Trudy Claspill Thanks for the explanation! It's clear for me now. I didn't fully understand for which issues the lookupIssues action was refering to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy Thanks for the suggestion! The next step for me was to definitely try to handle the case were a work item is added or removed/move to a different parent. I might actually rethink and try to create a rule that triggers daily to run through all the epics and sums the story points of the childs instead of creating 3-4 different rules. The tricky part is that we are running a 3 level hierarchy (Epic -> Feature->Story) so I need to figure out a way to "find" child of child and then sum all they way up to the EPIC. Might give it a try and repost if I get stuck :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have got to remember to recommend @Bill Sheboy's articles! He is so knowledgeable about Automation Rules.
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.