Calculating a "Score" based on 3 smartvalues multiplied

Nicholas Fuchs February 7, 2025

Hello Atlassian Community, 

I'm building an automation to calculate a Priority Score to set the field priority.
According to instructions i have, my first smart value should be {{FloatMonths}}, which is based in a number field  (Estimated Timeframe Delivery in months) (-) a lookuptable of the field Complexity, that contains High, Medium and Low (6,4,2).

The second one is Urgency Score, that should be the result of:
If {{FloatMonths}} is >= 2, UrgencyScore should be 1
If ((FloatMonths}} is between 2 and 4, Urgency Score should be 0.8
If {{FloatMonths)) is <4, UrgencyScore should be 0.7

The third SmartValue {{GrowthScore}} is basead in a dropdown field, which has percentages as options.
So, if Expected Annual Growth Rate (EAGR) is +12% -> 1
If 8% -> 0.9
if 4% -> 0.8

And the last one is based in a number field (Estimated First Year Benefit)
If this field has a value greater than USD 1kk -> 1
If between 0,5kk and 1kk -> 0.75
And if between 0 and 0,5kk -> 0,65

In the end, to achieve priorityscore i should multiply the 3 last smartvalues and map the values to set priorty field.

I'm getting sintax errors in the smartvalues and not achieving the calculations exactly.

What i ahve till now:
UrgencyScore

{{#if((issue.customfield_13652.asNumber | 0) - (FloatMonths.asNumber | 0) <= 2)}}1 {{else}}{{#if((issue.customfield_13652.asNumber | 0) - (FloatMonths.asNumber | 0) > 2)}} {{#if((issue.customfield_13652.asNumber | 0) - (FloatMonths.asNumber | 0) < 4)}}0.8 {{else}}0.7{{/if}} {{/if}}{{/if}}

GrowthScore

 

{{#if(issue.customfield_13800.equals("+12%"))}}1 {{else}}{{#if(issue.customfield_13800.equals("8%"))}}0.9 {{else}}{{#if(issue.customfield_13800.equals("4%"))}}0.8 {{else}}0{{/if}}{{/if}}{{/if}}

ValueScore

{{#if(issue.customfield_13859.asNumber > 1000000)}}1 {{else}}{{#if(issue.customfield_13859.asNumber >= 500000 and issue.customfield_13859.asNumber <= 1000000)}}0.75 {{else}}0.65{{/if}}{{/if}}

PriorityScore

{{GrowthScore.asNumber | 1}} * {{ValueScore.asNumber | 1}} * {{UrgencyScore.asNumber | 1}}

Looking for some guidnce, or help in this, please

1 answer

0 votes
Vishal Biyani
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.
February 7, 2025

@Nicholas Fuchs 

Can you rephrase like this

{{ #if(issue.customfield_13800.equals("+12%"), 1, 0 ) }}

 

refer this article to understand how the if logic works for filtering smart value lists

 

 

Nicholas Fuchs February 7, 2025

Thanks @Vishal Biyani 
I'm trying to understand the logic in the article, but i'm still confused within the Else part of my equation.

Vishal Biyani
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.
February 7, 2025

Yes, it is very confusing. Refer this link as well. This explains how if works

snip.png

Nicholas Fuchs February 7, 2025

If is not a problem enymore, i think i gor it.
Do you have any insights on the else to help me build this?

 

Vishal Biyani
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.
February 7, 2025

if you have if else if else kind of condition, then as per documentation, nesting is required

Something like below

{{#if(or(or(conditionA, conditionB), or(conditionC, conditionD)))}}success!{{/}}

 

Another thought is, if you have a key value pair then you can try for lookup table also.

Suggest an answer

Log in or Sign up to answer