Forums

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

Calculations in automation

Gabriela Carrion
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2023

Hi team,

 

I have to numerical fields : {{SLA (d)}} and {{Lead Time (SD) (hours) }}.

I want to calculate remaining SLA, which would be :

{SLA (d)}} - ( {{Lead Time (SD) (hours)}} * 24)

BUT this is not working properly.

Also, would be the best case scenario if I have green for positive values, red for negative values. (but I can drop this requirement) and formatted like X,X

 

Can someone please help me?

 

1 answer

0 votes
Trudy Claspill
Community Champion
June 13, 2023

Hello @Gabriela Carrion 

Can you show us the full automation rule, the details of the step where you are doing the calculation, and details about how exactly it is not giving you the result you expect? Can you provide sample values and the results of the calculation?

I don't understand what you are trying to achieve with this:

Also, would be the best case scenario if I have green for positive values, red for negative values. (but I can drop this requirement) and formatted like X,X

Are you trying to add color to a field, or change the color of a font? What are the two X values? Where are you trying to present that information?

Gabriela Carrion
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 14, 2023

Yes, sure. Let's go:

I have two fields, will send example values:

Lead Time (SD) (hours) : 200

SLA (days) 5

What I am trying is to see the remaining SLA days, what would be by calculation:

200 / 24 = 8.3

5 - 8.3 = -3.3 (in the best case scenario, as is negative and we already are over SLA, font color should be red)


 

My current automation:

* Every 4 hours, apply the calculation in a jql filter sample 

* Edit field "Remaining SLA (d)" with the calculation:

{{SLA (d)}} - ({{Lead Time (SD) (hours)}} * 24)

 

Thank you!

Trudy Claspill
Community Champion
June 14, 2023

You said the calculation is not working, but you didn't say what result you are actually getting. However, I can see an error in the calculation you said is in your automation:

Here you are multiplying your Hours value by 24 rather than dividing it by 24. As you stated earlier, you need to divide the Hours value by 24 to convert it to days.

Screen Shot 2023-06-14 at 9.03.02 AM.png

 

You said you want to turn "the font" red when the result is negative. Where is the text where you want to display the font color? Are you posting the result of your calculation into a field that is part of the issue? Are you sending an email with this automation and want the font color in the email?

Suggest an answer

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

Atlassian Community Events