Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sum issues in epic

Lana Kelly
Contributor
September 25, 2023

Hello everyone,

I'm back with another automation question 😅.  I've read all the suggested posts and they make sense, but there must be some small error I'm making that I'm not noticing.

We have an epic which has a custom field called "Residual Quantified Risk."  Every issue in the epic has a field called "Quantified Risk."  I want to sum the Quantified Risks from the issues into the Residual Quantified Risk in the Epic.  This is what I have so far.  The audit log says only "config change," even though I've tried to trigger it many time.

Thank you again for your help!

 

 

3 answers

2 accepted

0 votes
Answer accepted
Lana Kelly
Contributor
September 25, 2023

Good morning from blustery Finland!  It is definitely the right audit log, and it's a company-managed project.

Screenshot 2023-09-26 at 9.09.38.png

 

I already tested changing the editing part, so that changing the QR would change the summary, and that worked.  It's just the part where it sums the QRs in the RQR field that doesn't work.

Jack Brickey
Community Champion
September 26, 2023

Hi @Lana Kelly , Finland is on my travel list one day...

so you need to have a lookup issues component immediately after your epic branch component...

Then lookup issues JQL parent = {{issue.key}}

Like • # people like this
Lana Kelly
Contributor
September 27, 2023

Okay, so it found the correct issues, but now it's still not summing anything.

Jack Brickey
Community Champion
September 27, 2023

Please share your current rule via screenshot.

Lana Kelly
Contributor
September 27, 2023

Screenshot 2023-09-27 at 15.51.54.png

Jack Brickey
Community Champion
September 27, 2023

Actually, I wish to see the entire rule if possible.

Lana Kelly
Contributor
September 27, 2023

It's much the same as when I firstScreenshot 2023-09-27 at 16.18.10.png posted, just with a new lookup portion.

Screenshot 2023-09-27 at 16.18.35.png

Jack Brickey
Community Champion
September 27, 2023

can you replace "lookup" in your edit issues JSON with "lookupIssues"? If that does not work can you simply place {{lookupIssues.Quantified Risk.sum}} into the short form field box as in below example rather than in more options?

 

IMG_2691.jpeg

Like • # people like this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2023

Yes, and...if that does not work, the smart value for the field may be incorrect.  Sometimes a field's display name on screens is different than the smart value.

You can check that using this how-to article to identify your smart value, or use the custom field id as an alternative: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Like • Jack Brickey likes this
Lana Kelly
Contributor
September 27, 2023

Oh my goodness, the last bit was the lookupIssues.  You know how you change things many times to test why it's not working and then forget to change it back...?  Thank you so much @Jack Brickey and @Bill Sheboy

Now just to change the trigger and hope it still works.

Lana Kelly
Contributor
September 27, 2023

It does not 😔.  I added this trigger (and took away the "If issue type is Threat" condition, since it's a project rule)

Screenshot 2023-09-28 at 8.59.08.png

Jack Brickey
Community Champion
September 28, 2023

Hi @Lana Kelly , I see you accepted the answers here but your last comment seems to convey you still have issues? If things still are not quite right please let's us know.

Lana Kelly
Contributor
September 28, 2023

I accepted the answers that fixed the formatting problem for my lookup part, but the triggering is still not working correctly.

Jack Brickey
Community Champion
September 28, 2023

to be clear if you use Manual trigger the rest of the rule works but if you trigger on the field changing and you change the field then the rule does not trigger. Is that correct?

Lana Kelly
Contributor
September 28, 2023

That's correct.  

Jack Brickey
Community Champion
September 28, 2023

Thanks for confirming. So it certainly seems odd. Can you or have you tested with using a different field recently? For example, if you change the trigger based on The priority field. If that works then test out a custom field, if you have one. And just to be sure, you checked the Audit log and are not seeing the rule trigger. I just want to ensure we are not instead seeing "some errors" or "no actions performed " instead.

Lana Kelly
Contributor
September 28, 2023

Okay, so when I changed the trigger to "When value changes for Severity," then the rule kicks in and the RQR is updated properly.

When the trigger is "When value changes for Quantified Risk," then the rule doesn't trigger, and the log shows the last rule execution was 3 minutes ago (when I changed the trigger to Severity) and the last item in the log is "Config Change"

I thank you deeply for your patience with me in fixing this tedious thing.

Jack Brickey
Community Champion
September 28, 2023

No worries Lana I am glad to assist.

what type of field is QR? Though all types are supported I believe. Are you absolutely sure the field is getting updated? Are you testing with the same issue that was triggering when Severity was used?

I have to wonder if we are hitting a bug but it really would surprise me as the Community would be blowing up with posts on this which it is not.

Jack Brickey
Community Champion
September 28, 2023

Another test to run...

change the trigger to "issue updated" then ONLY edit the QR field and observe results. Does it trigger? If not then the issue lies with detection of change made to QR. if it does trigger the the issue lies with the "field changed" trigger specifically for the QR field or field type. It would also, be interesting to test the field changed trigger with another field of the same field type as the QR. If you happen to have such a field.

Like • Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2023

When a field is not listed for the Field Value Changed trigger (or does not seem to trigger the rule), Jack is correct that the generic Issue Updated trigger can be tried.  And then use an advanced compare condition to determine if your field changed by checking the changelog:

  • first value: {{#changelog.yourFieldName}}{{fromString}}{{/}}
  • condition: does not equal
  • second value: {{#changelog.yourFieldName}}{{toString}}{{/}}

 

Yes, and...FYI some fields from marketplace addons can be calculated dynamically and so do not trigger rules.  Those cannot be detected...unless there is a webhook to set up for the external product.  This does not seem to be the case for this rule...correct?

Like • Jack Brickey likes this
Jack Brickey
Community Champion
September 28, 2023

indeed...puzzled and anxious to understand the culprit @Lana Kelly 

Lana Kelly
Contributor
September 29, 2023

what type of field is QR? Though all types are supported I believe. Are you absolutely sure the field is getting updated? Are you testing with the same issue that was triggering when Severity was used?

The QR field is a number field.  I'm absolutely sure it's being changed.  It's a mathematical operation from other fields, so the value changes in real time (or as near to real time as Jira can get).  Is it possible it's not changing because the value is an equation, and since the equation never changes, it never triggers?

Jack Brickey
Community Champion
September 29, 2023

Ah!

how is that field being updated? Is there another automation rule? You say this is an equation but Jira natively does not have any mathematical fields. As @Bill Sheboy mentions Automation does not support addon custom fields. I fear that is what we are dealing with here. 😬

Lana Kelly
Contributor
September 29, 2023

@Jack Brickey @Bill Sheboy I've changed the trigger to be when either the Likeliehood or Severity changes (which would cause the QR to change, since it's a function of those two), and the RQR updates.   So, basically, the flow looks like this:

Likelihood * Severity = Quantified Risk

So, for Threats A and B, the equation for RQR for the overall risk is:

(LikelihoodA * SeverityA) + (LikelihoodB * SeverityB).

 

Changing the trigger to make it so if likelihood or severity changes in the project, the RQR will update is sufficient, I suppose.  I'd still like to know why the change in QR doesn't trigger a change in RQR, but perhaps it's just One Of Those Things.

Lana Kelly
Contributor
September 29, 2023

It's another automation rule (which @Bill Sheboy helped me with earlier)

It creates two lookup tables for Likelihood and Risk, and then multiplies them

{{#=}}{{SeverityTable.get(issue.Severity)}} * {{LikelihoodTable.get(issue.Likelihood)}}{{/}}

 

Nothing is an addon.  Everything is done natively. :)

Jack Brickey
Community Champion
September 29, 2023

Please see my last response that overlapped your update.

Jack Brickey
Community Champion
September 29, 2023

Ok so then in the QR trigger go to the Details of the rule and ensure you have this box checked...

"Check to allow other rule actions...".

my bet is on this being the problem.

Lana Kelly
Contributor
September 29, 2023

Oh my goodness!  That was it!!!  Thank you so much!  I didn't even know that was an option.  I just assumed that all rules would trigger always.  A huge thank you to you @Jack Brickey and @Bill Sheboy for being so patient and knowledgable!

Like • # people like this
0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2023

Hi @Lana Kelly 

Your rule is referencing a Lookup Issues result to sum the field, but your rule does not have a Lookup Issues action.

Please add that action, with the JQL to gather the children of the epic, before your edit and the rule will work as you expect.

Kind regards,
Bill

Jack Brickey
Community Champion
September 25, 2023

agreed and that was my next comment but then I also saw what I thought led me to my last inquiry on TMP vs. CMP. I wanted to provide a full working example but needed that bit first.

Like • Bill Sheboy likes this
Lana Kelly
Contributor
September 25, 2023

How do you search for the relevant issues?  I've tried

parent = {{issue.key}}

parentEpic = {{issue.key}}

parent = issue.key

parentEpic = issue.key

"Epic link" = {{issue.key}}

"Epic link" = issue.key

0 votes
Jack Brickey
Community Champion
September 25, 2023

Hi @Lana Kelly , could you please share an image of your rule? 

Lana Kelly
Contributor
September 25, 2023

Ah, sorry.  I thought they had attached, but apparently not.Screenshot 2023-09-25 at 14.40.06.pngScreenshot 2023-09-25 at 14.34.58.pngScreenshot 2023-09-25 at 14.34.11.png

Jack Brickey
Community Champion
September 25, 2023

Thanks. So you are saying the rule is not triggering, correct? Is this a single project rule and are the issues in the same project? I assume there is only one "quantified risk" field in your instance (just want to rule that out as the problem)?

while we are trying to resolve the trigger issue you might test the rest of your rule by changing the trigger to manual temporarily.

Lana Kelly
Contributor
September 25, 2023

I changed it to manual trigger, and it says success, but it hasn't updated the field.  It's a single project rule and all the issues are in this project, yes.  And there is only one "quantified risk" field, which is a number field (same for "residual quantified risk")

Jack Brickey
Community Champion
September 25, 2023

Not triggering - so you are editing the QR for an issue and it is not triggering? I assume this is a number field. It would be interesting to test triggering on a different field changing. This would help us understand if the issue is with detecting whether the rule can't detect changes to QR only or any field. You could test with something like priority or some other custom field.

not summing:

  • Can you share the audit log?
  • what was the value in each QR and the epic's RQR field
Lana Kelly
Contributor
September 25, 2023

I changed the automation to change the description of the epic, and that worked, so it has something to do with the command to sum the QR fields and enter that value into the RQR field.  

This is the original screen.  The RQR field is on the right.  The QR field is the same automation as the issues in the epic.

Original Epic screen.png

This is the original Aliens Invade issue.

Original Aliens Invade Issue.png

This is the changed Aliens Invade issue.  The QR has changed according to the automation.

Changed Aliens Invade Issue.png

The Epic stays the same.

Still the same.png

And here, it shows the execution.

Epic showing rule executions.png

Then, I changed the automation to change the summary when triggered and it did.

Jack Brickey
Community Champion
September 25, 2023

I will unpack all of this in a bit when I get back to my computer. However, the fact that it isn't triggering still bugs me. Whether or ONT the summing is working or not it has nothing to do with triggering. You can check this by gutting all of the current conditions and actions and simply add a single action that comments on the issue that triggered the event. Then on a given issue change the QR and see if the comment is added.

Jack Brickey
Community Champion
September 25, 2023

Hi @Lana Kelly , I am hung up on the rule not triggering when updating the QR. I want to confirm that you are in in fact looking at the Audit log under project settings > automation for the associated rule. Please confirm.

Jack Brickey
Community Champion
September 25, 2023

question....

is this a Team or Company managed project? I am wondering if you are are using Epic (parent) (CMP) in your branch rather than Parent (TMP).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events