Forums

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

Errors while using smart values to calculate totals when one of the value is 0

Valerie Blondel
Contributor
March 2, 2023

Hi Team,

I am trying to calculate a risk score using a smart value.

This risk score is the multiplication of 4 different values.

Easy, except if one of the values is 0.

Good calculation.png         Bad calculation.png

Here is the automation :

Automation.png

 

And here is my smart value calucation :

{{#=}} {{issue.Menace.value}} * {{issue.Vulnérabilité.value}} * {{issue.Impact.value}} * {{issue.Vraisemblance.value}} {{/}}

 

What could I do to prevent this ?  Is there a way I can ask Jira to "disregard" a field in which the value is 0  ?

 

Thanks beforehand !

 

Valérie

 

 

3 answers

2 accepted

0 votes
Answer accepted
John Funk
Community Champion
March 2, 2023

Hi Valerie,

I guess the simple answer would be to not allow a value of 0.

0 votes
Answer accepted
Najm Polaris
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.
March 2, 2023

Hi @Valerie Blondel , 

anything multiplied by zero is always going to be zero. Your formula seems to be working perfectly. 

If you don't want to consider the zero than any field which is zero just change it to 1. This should serve your purpose. 

Just check if any of the 4 fields are 0 or not. If they are change them to 1. The rest should be same. 

0 votes
Valerie Blondel
Contributor
March 3, 2023

Hi @John Funk and @Najm Polaris

Thanks for taking the time to answer me.

I would have preferred to keep the 0, but I can live without it.

Now comes the difficult part (for me of course, just starting with Jira smart values)

 

Calcul indice risque global.pngAutomation working well :

  • "Total risk score" = "Vulnérabilité"*"Menace"*"Impact" ON EACH ISSUE (3*3*3 on Risk IT 1, 1*3*1 on Risk IT 2…)

What I am trying to achieve : 

  • "IT Indice de risque total" = "Total risk score" of RISK IT 1 (27) + "Total risk score" of Risk IT 2 (3) = 30.  Value 30 should appear in field "IT Indice de risque total" of all issues of the project.
  • "RH Indice de risque total" = "Total risk score" Risk HR 1 (6) + "Total risk score" Risk HR 2 (3) = 9.  Value 9 should appear in field "RH Indice de risque total" of all issues of the project.

 

==> If  the « Total risk score » field does change, in any « Processus IT » issue in the project, I would like the « IT Indice de risque total » to be automatically adapted in all the issues of the project (IT issues and HR issues).


==> If the « Total risk score » field does change, in any « Ressources Humaines » issue of the project, I would like the « RH indice de risque total » to be automatically adapted in all the issues of the project (IT issues and HR issues).

I have more than 100 issues in the project, but less than 100 issues IT, and less than 100 issues RH.

 

Do you think it could be done ?  Or am dreaming too big ?

Thanks a lot,

Valérie

John Funk
Community Champion
March 11, 2023

I would try to do one at a time - whichever one is needed for the base. Try to create your rule and then we can troubleshoot from there. 

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