Calculating a percentage of a value and assign to a field

Madar_ Andrew May 21, 2024

I want to add two fields together and multiply it by 20% but it's not working.

Is this correct syntax?

{{issue.customfield1.plus(issue.customefield2).multiply(.2)}}

 

 

1 answer

1 accepted

1 vote
Answer accepted
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.
May 21, 2024

Hello @Madar_ Andrew 

What is the context where you are using this? Is it an Automation Rule? If so, please show us the complete Automation Rule and the details of the step where you are trying to use that syntax.

Madar_ Andrew May 21, 2024

Hi Trudy, I am using the edit field

 

20 percent.JPG

Is my syntax correct to use multiply for a decimal point in parans?

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.
May 21, 2024

When I used (.2) I got an error in the Audit Log for the rule. Do you get an error in the log?

Screenshot 2024-05-21 at 2.05.45 PM.png

When I used (0.2) I did not get the error, and I got the correct value.

Like # people like this
Madar_ Andrew May 21, 2024

okay, that's good to know.  I did get an error when I used (.2) initially.  Before I read your response, I changed it to (0.2) but have not checked it yet.  I guess it requires #.# for decimals?

Madar_ Andrew May 21, 2024

I just checked it and it is working now with (0.2) format.  Thank you!!!

 

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.
May 21, 2024

I'm glad I could help you.

I don't see any statement in the documentation that decimal numbers require a leading zero.

If my answers have helped you solve your problem please consider clicking on the Accept Answer button. That will mark your post as Solved, which helps others searching for answer find posts with validated solutions.

Like Madar_ Andrew likes this

Suggest an answer

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

Atlassian Community Events