I would like to create an automation that triggers on schedule, filters with JQL relevant Epics or Stories (Simple query on a specific field) and per each, it calculates:
looking at a previous discussion (https://community.atlassian.com/t5/Jira-questions/Automation-Rule-calculate-progress-based-on-children-of-linked/qaq-p/2159555) led by @Bill Sheboy i still wasn't clear how to use the suggest smart value
Thanks..!
I see two things with what you show:
1) There is no Lookup Issues action in your rule to gather the issues.
2) The expression you show is missing the closing parenthesis and digits for the ROUND function. In my original post, I showed this:
{{#=}}ROUND((0+{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}{{Story points|0}}+{{/}}{{/}}0)/{{lookupIssues.Story points.sum|0}}*100,0){{/}}
Kind regards,
Bill
Thanks @Bill Sheboy !
Although made these two modifications and don't get any error, the sum I get is "0".
Formula was fixed with your help :
{{#=}}ROUND((0+{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+{{/}}{{/}}0)/{{lookupIssues.Story points.sum|0}}*100,0){{/}}
And for this epic, i have 2 child issues, each has 3 SP - One is "done" and one "To do" so i was expecting to get "3" (or 50%)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post an image of the audit log details showing the rule execution. That may provide more context for what you are observing. Thanks!
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.
Thanks Bill, for stepping up. This surely helps.
:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gilad, what type of project are you using: Company-managed or Team-managed? You may find that information in the project list or at the bottom-left of the screen expanding area.
Why that matters...
Company-managed projects use the Story points field, and Team-managed projects use the Story point estimate field (even though they are both called "Story Points" in the UX).
If using a Team-managed project, please update the expression to use the other smart value and re-test. Also note smart values are case-sensitive, to please check that also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
:/ The project is Company-managed.... i wonder what could be the issue...
From the logs it looks like the lookup manage to run on the tickets, and although each of the tickets has SP (3+3) it does not reads it....
@Bill Sheboy / @Dick any other ideas on what could go wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let's try some writes to the audit log to diagnose this...
Please add an action to write to the audit log after the Lookup Issues action, then re-test:
looked up issues and story points: {{#lookupIssues}}{{key}}: {{Story points}} points; {{/}}
Based on what you described, that should produce something like this:
IL-46268: 3 points; IL-37207: 3 points;
Please post an image of the audit log after you run the test.
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.
Great! Now let's update that audit log write to include the status information to observe if they are filtered out:
looked up issues: {{#lookupIssues}}{{key}}: {{Story points}} points in {{status.name}} ({{status.statusCategory.name}}); {{/}}
Hold on...I just reviewed your earlier post and it is missing the story points field! Please post an image where you are using this expression:
{{#=}}ROUND((0+{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}{{Story points|0}}+{{/}}{{/}}0)/{{lookupIssues.Story points.sum|0}}*100,0){{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Boom!!
That worked!!
Apologize on the back and forth and for missing that part, this formula is a bit confusing...
Thanks a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
And...I recommend pausing to understand how that expression works, perhaps re-reading the original thread description, and then explain the rule to a teammate. Doing so will help with rule maintenance / improvements in the future.
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.
Resurfacing this one again as although automation works just fine thanks to @Bill Sheboy - I believe the logic is not working well..
The automation is time triggered, and i have used the lookup issue function to capture all child issues of certain tickets. To do so i used the enhanced scriptrunner function of "ChildrenOf".
Next, i created the variable to run over the lookup issues according to the logic Bill helped me to set (and again, thank you) :
{{#=}}ROUND((0+{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}{{Story points|0}}+{{/}}{{/}}0)/{{lookupIssues.Story points.sum|0}}*100,0){{/}}
What I wanted to do was to run on specific epics and according to their SP progress to run actions. The issue i suspect is happening is that the lookup is running on ALL CHILDREN and not divided per epic. In that case, i will never get a value per the epic completion rate.
Any ideas how to approach this logic?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to run this for each Epic, please consider:
AND parent={{issue.key}}
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.
Hi Gilad,
Which part is giving you a headache?
{{#=}} Start a calculation
ROUND((0+ Round the number function
{{#lookupIssues}} Iterate over the issues looked up by a jql statement
{{#if Start a conditional statement
(equals Look for equal parts A and B
(status.statusCategory.name Part A, the status of the looked-up issue under investigation
,"Done") Part B, is the status equal to Done
)}} Conditional statement is finished, could be true or false
Conditional is true, do the following
{{Story points|0}} Read the issue's story points. if that's empty, use zero
+{{/}}{{/}}0) Ends the if when conditional is false, add zero
/{{lookupIssues.Story points.sum|0}}*100 Sum up the story points of all issues (if sp is null use zero)
,0) give zero as an answer for this issue if the denominator is zero
{{/}} End the calculation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Dick for the clarification. ill be more specific
Im getting this error: Mismatched parentheses: ROUND((0+0)/0*100
While using this calculation:
{{#=}}ROUND((0+{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+{{/}}{{/}}0)/{{lookupIssues.Story points.sum|0}}*100{{/}}
I suspect my problem is related to {{#lookupIssues}} but not 100% sure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gilad
Thanks for elaborating a bit on the problem you're facing, makes it easier :)
The error is about parenthesis not matching (and message you post clearly has a closing parenthesis missing).
Looking at your math line, there's a discrepancy too:
{{#=}}ROUND( (0+{{#lookupIssues}} double open
{{#if(equals(status.statusCategory.name,"Done"))}}+ double open double closed
{{/}}{{/}}0) single closed
/{{lookupIssues.Story points.sum|0}}*100{{/}}
So I suggest removing the one surplus parenthesis after the word ROUND.
hope this helps,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I now notice that Bill's line also seemed to be missing a closing parenthesis.
With all the curly braces and parentheses, this can easily happen. So it's best to check using the above method to see if there is consistency in your formula's.
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.