{{lookupIssues.Story Points.sum}} not working for me.

gordon.varney January 9, 2025

The goal is to: when a story, already attached to an Epic, has it's Story Points changed, that triggers automation to, from the triggering story, to looking at the associated Epic, find all the issue under that Epic, add up their individual Story Points, put that number in the Epic's Story Point field, drop a note in the Comments field, and be done.

There is quite a collection of asks and answers around this for regular fields, custom fields, adding up specific fields, whatever. I just can't get this to work. All the peripheral stuff does: I can write to the Labels field, I can write to the Comments field.

If I manually put some number in the Epic's Story Point field before triggering the automation, when the automation runs, it always overwrite the existing number with 0.

 

What am I doing wrong?

 

Cheers.

 

JGV

 

Overall Automation

Screenshot 2025-01-09 at 1.06.14 PM.png

 

Detail on the Story Points Calc

Screenshot 2025-01-09 at 1.06.25 PM.png

 

Pre-Changing a Story's Points

Screenshot 2025-01-09 at 5.18.50 PM.png

 

Post-Changing a Story's PointsScreenshot 2025-01-09 at 5.19.39 PM.png

2 answers

2 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2025

Hello @gordon.varney 

My suspicion is that the problem is your Lookup Issues JQL statement:

parent={{triggerIssue.parent.key|"null"}}

Why did you add |"null" ?

You might want to add a Log action after that to confirm that your Lookup Issues action is actually returning issues. You can log the smart value {{lookupIssues.size}} to see how many issues were found.

 

I would suggest putting the Lookup Issues action within the For Parent branch and use the JQL:

parent={{issue.key}}

There is no reason to execute the Lookup if the trigger issue doesn't have a parent. If the trigger issue doesn't have a parent, then the For Parent branch will not be executed.

 

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.
January 9, 2025

Hi @gordon.varney 

Adding to Trudy's suggestions:

Your rule has multiple Edit Issue actions.  Those changes potentially walk-over / collide with earlier saved data as actions use the current state of the issue in the rule's storage for the edit (and not what is stored in the cloud).  This is intentional and is not a defect in the rule engine.

 

Why are you editing the issue multiple times rather than one time, selecting and updating the different fields needed?

When you need to edit an issue in a rule and have those results available for later steps, add the Re-fetch Issue action after the edit to reload the data.  However this is likely not needed for the rule you show.

 

Kind regards,
Bill

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 10, 2025

Hello @gordon.varney 

Referencing your latest rule version:

Screenshot 2025-01-10 at 8.15.42 AM.png

I would not expect this version to get you the result that you want.

For one thing in the last log message {{issues... is not a valid smart value. It would require that issues be a reference to a list of issues, but you have not taken any action to get a list of issues.

Here is the gist of the change I suggested - moving the Lookup Issues action inside the branch. I'm just using Log actions, not actually editing anything.

Screenshot 2025-01-10 at 7.49.52 AM.png

1. When the Story Points field is changed

2. Shift focus to the trigger issue's Parent. If the trigger issue has no Parent, then the rule doesn't execute any portion of this branch.

3. Search for the child issues of the Parent. At this point in the rule {{issue}} refers to the Parent of the trigger issue, so {{issue.key}} is the key for the Parent of the trigger issue.

4. Here we are printing the count of issues found. In this case it should be at least one because otherwise this branch would not be executing.

5. Print the sum of the Story Points fields for the issues found by the Lookup Issues action.

 

Some refinements that can be made:

Screenshot 2025-01-10 at 7.46.42 AM.png

Lookup only the child issues that actually have a Story Points value. With this refinement the results set could possibly be no issues. 

Screenshot 2025-01-10 at 7.52.17 AM.png

If the result set might be zero, then we add |0 to the sum statement. That tells Jira that if the sum function doesn't produce a value, use 0 as the value.

 

 

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.
January 10, 2025

Yes, and...

The plural {{issues}} smart value is only supported for Jira Data Center's bulk-handling feature, not for Jira Cloud automation.  (Although experimentation I did years ago showed it does return unpredictable "stuff" when used in a Cloud rule :^)

Like Trudy Claspill likes this
gordon.varney January 10, 2025

Good morning. So, changed to your example Trudy. Using "issueS". Writes to log produced the static text but not the variable.

 

Screenshot 2025-01-11 at 12.35.28 AM.png

 

And just for kicks and giggles, I tried "issuE" - no S. same result.

So, am it totally then barking up the wrong tree? This is NOT going to work?

Cheers.

JGV

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 10, 2025

Please post a new image of your rule.

What exactly are you referencing in my example? I don't believe anywhere in my example have I used a reference to issues with a capital "s" at the end. But maybe I'm not seeing it because I have looked at it multiple times.

Smart values are often case and space sensitive. With the lookupIssues portion of the smart value all letters need to be lower case except for the "i"

gordon.varney January 12, 2025

Over all automation

Screenshot 2025-01-12 at 5.39.04 AM.png

 

First condition, trigger

 

Screenshot 2025-01-12 at 5.39.29 AM.png

 

Second condition, in branch

 

Screenshot 2025-01-12 at 5.39.44 AM.png

 

Third condition

 

Screenshot 2025-01-12 at 5.39.59 AM.png

 

Fourth condition

Screenshot 2025-01-12 at 5.40.12 AM.png

 

 

Fifth condition,

Screenshot 2025-01-12 at 5.40.48 AM.png

 

 

Results

 

Screenshot 2025-01-12 at 5.41.08 AM.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2025

Thank you for that additional information. 

The lookupIssues smart value does need an "s" at the end; plural lookupIssues rather than singular lookupIssue.

gordon.varney January 12, 2025

Well, getting there.

Changed lookupIssue to be lookupIssues and it now counts the number of issues.

It calculated just fine = 3.

It returned the sum as zero.

Tried playing with that  every way I could think of.

 

First lookupIssues item this now works.

Screenshot 2025-01-12 at 6.15.25 PM.png

 

This is how the second lookupIssues looks. And it returns 0.

Screenshot 2025-01-12 at 6.16.26 PM.png

 

And results in the log...

 

Screenshot 2025-01-12 at 6.15.46 PM.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2025

The log should include the keys for the trigger issue and the issues found by the Lookup Issues action. Have you reviewed the child issues to confirm that at the time this rule ran those issues had non-zero values in their Story Points fields?

An additional condition you may want to add as the first component within the branch is a Field Value condition to confirm that the parent issue is Issue Type equals Epic.

As the rule is currently written, technically the rule could run for other combinations of parent and child issues; i.e. Task and Sub-task, parent of Epic and Epic.

gordon.varney January 12, 2025

Screenshot 2025-01-12 at 6.41.05 PM.png

gordon.varney January 12, 2025

Will add that additional condition now.

 

gordon.varney January 12, 2025

Screenshot 2025-01-12 at 6.45.33 PM.png

 

Screenshot 2025-01-12 at 6.46.30 PM.png

 

I just don't get it?????

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2025

Hm. The look of your Audit Log interface is different from mine. I wonder why.

Some times a rule that has been edited may times may start behaving in an unexpected manner. Can you disable this rule, and then try recreating it again from scratch? Don't copy anything - start with creating a brand new, empty rule and add each component again.

I have created the same rule (without the condition to confirm the parent is an Epic) and it works correctly.

Another thing that I tried was adding a Log action to log the issue key and Story Points value of each child issue.

 Screenshot 2025-01-12 160324.png

Screenshot 2025-01-12 161517.png

In this case 3 of the 6 issues really do have no value for Story Points.

gordon.varney January 13, 2025

Trudy, thank you so much for hanging in there with me. I tried reproducing some of what you did above, with these results. And I did type the whole thing in again.

JIRA can take the path from a Story's points changing, to the Stories Parent, to counting how many issues are under the Epic just fine. It can even give us the numbers of those three issues. It just won't read their story points.

 

Hmmmmm. Going to try writing, hard coded, the first issues story points and see if we can see that.

 

Screenshot 2025-01-13 at 7.37.18 AM.png

Screenshot 2025-01-13 at 7.37.41 AM.png

gordon.varney January 13, 2025

So, played some more. My JIRA is not seeing the story points field. Seemingly on anything. Just noted, there are two smart values for Story Points. Am I using the wrong one? Everything I see on our instance says Company-managed.

 

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.
January 13, 2025

Hi @gordon.varney 

Out of the box, Jira unfortunately has two fields depending upon the project type:

  • Company-managed projects use the "Story points" field, with a smart value of {{issue.Story points}}
  • Team-managed projects use the "Story point estimate" field, with a smart value of {{issue.Story point estimate}}

If you see another "Story points" field in your global configuration (i.e., for company-managed projects) then someone added another one, and that is causing problems.

To quickly solve this, please identify the custom field ID for the correct field and use that: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Then research why an additional field was added and resolve that problem to reduce future problems.

Kind regards,
Bill

Like Trudy Claspill likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 13, 2025

That is precisely what I was going to advise as the next step!!

0 votes
gordon.varney January 10, 2025

Removed.

Suggest an answer

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

Atlassian Community Events