Getting invalid JSON

Tamir Melamed March 20, 2024
{
"fields": {
"Story Points": {{#=}}{{subtasks.Story Points.join(" + ")}}{{/}}
}
}

 

2 answers

1 vote
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2024

Hi @Tamir Melamed ,

You should use:

{{#=}}{{issue.subtasks.Story Points.sum}} {{/}}

Otherwise you get a string like  "4+13+7" which does not compute.

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.
March 20, 2024

Hi @Rudy Holtkamp 

A math expression wraps the original question's use of join() and so that will work...unless there are other problems.

And, when using the sum function the math expression wrapper is not needed.  Instead that would be just {{issue.subtasks.Story points.sum}}

Kind regards,
Bill

Like # people like this
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2024

@Bill Sheboy thanks for correcting me.

 

0 votes
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.
March 20, 2024

Hi @Tamir Melamed 

Context is important for automation rule questions...

Please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

The JSON expression you show could have several problems, or it could work as written, depending upon how it is used in a rule.  Some likely causes of problems are:

Smart values are name, spacing, and case-sensitive.  When an incorrect smart value is used, it often is replaced with null, and may show no or unusual errors.  The smart value for the story points field is "Story points" for a company-managed project...

Are you using a company-managed or a team-managed project?  You may find this information at the bottom-left of the screen expanding area.  Company-managed projects use the {{issue.Story points}} smart value and team-managed projects use {{issue.Story point estimate}}

Do all of the subtasks have a value for the field?  If they do not, when the math expression is processed it can create null values between the plus signs.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events