Forums

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

I want to sum the values of variables with smart values

青山 明
Contributor
July 6, 2023

I got the value of each custom field of the numeric attribute in the jql query. When the acquired result variable (A) is displayed in the log, it has the following five values.
A = 5,2,3,6,7
I want to sum these 5 values, but what kind of smart value should I specify?

1 answer

1 vote
Joseph Chung Yin
Community Champion
July 6, 2023

@青山 明 -

If the each value is coming from different fields, then you can conduct math expression "plus/minus" to return the Sum of them.  Please refer to the following smart value reference page for your information - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

青山 明
Contributor
July 6, 2023

Each value is a list of results from the same field, not different fields.

What happens in that case?

Joseph Chung Yin
Community Champion
July 6, 2023

@青山 明 -

In JSM Cloud Automation, you can create a local variable in the rule, and you should be able to use it to pull in the each result and store it.  Afterward conduct the sum of the local variable.

One more thing - What do you mean "a list of results from the same field"?  please clarify.  How did the field got populated with the value?

Please advise.

Best, Joseph

青山 明
Contributor
July 6, 2023

If the query result variable A has the following values,
I just want to get the sum of the values of that variable A: 10.
A = 2,2,3,2,1

Suggest an answer

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

Atlassian Community Events