Forums

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

Need help for calculation

nasiruddin.nordin November 30, 2023

Hi team,

 

I need help to create a subtraction of values (numbers) in my automation. I have 3 custom fields name as below : 

1. Result

2. Duration A

3. Duration B

All 3 of these custom fields are number types set in custom field as well.

I need help to make the subtraction of A from B then the outcome should be Result.

B-A = Result.

 

I have tried with 

{{issue.customfield_A.minus(issue.B)}}

{{issue.customfield_B}} - {{issue.customfield_A}}

 

but both did not work and I cant find out why because the result does not appear and in audit log it appears as success :( 

2 answers

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.
November 30, 2023

Hi @nasiruddin.nordin 

Context is important for understanding problems with automation rules.  

For a question like this, 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!

Kind regards,
Bill

nasiruddin.nordin December 1, 2023

{{issue.customfield_10399.minus(issue.customfield_10374)}}

this was my automation rule.

 

it states success but not result.Image 01-12-2023 at 4.32 PM.jpeg

Image 01-12-2023 at 4.31 PM.jpeg

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.
December 1, 2023

I was asking to see your complete automation rule, for context.  Not just the smart value expression you are trying.

It is possible the result is null or empty because of the way the expression is used.  Seeing the entire rule and audit log details will help to clarify that.

When posting the audit log details, please show the entire image for the details of the rule execution.  That will show which steps did, or did not, execute.

0 votes
Ste Wright
Community Champion
November 30, 2023

Hi @nasiruddin.nordin 

This worked for me.

I used the Custom Field IDs...

  • A = 10123
  • B = 10456

To get B-A...

{{issue.customfield_10456.minus(issue.customfield_10123)}}

Ste

nasiruddin.nordin December 1, 2023

thats what I did but there's no result that came out. It states success in the audit log. 

 

For the result, what is the data type that can come out with the result? numbers? Strings?

Ste Wright
Community Champion
December 1, 2023

Hi @nasiruddin.nordin 

In this instance - A, B, and Result are all number fields. Is this the same in your scenario?

Ste

Suggest an answer

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

Atlassian Community Events