Forums

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

Using automation to calculate a multi select list values.

Mat Levell August 16, 2024

 

Hey all, Im trying to created a weighted priority score based on user selecting questions in a multi select list. 
I first attempted to use a lookup table (similar to this thread) but I got stuck. I couldn't event get anything to wire to the Priority score (number field).

Screenshot 2024-08-14 at 12.53.46 PM.pngScreenshot 2024-08-14 at 12.54.41 PM.png

 

I then abandoned the lookup table and tried multiple if statement

{{#=}}
{{#if(issue.customfield_10295.value.contains("Is the issue present on all vehicles?"))}}20{{/}}
+
{{#if(issue.customfield_10295.value.contains("Is the issue present on all models?"))}}50{{/}}
+
{{#if(issue.customfield_10295.value.contains("Does the issue result in a model being banned?"))}}100{{/}}
{{/}}

Screenshot 2024-08-15 at 2.29.25 PM.png

 

Any help would be amazing.

2 answers

1 accepted

1 vote
Answer accepted
Kalyan Sattaluri
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.
August 16, 2024

Hello @Mat Levell 

Please try to loop through the values and check individually...

{{#=}}0
{{#customfield_10295}}
{{#if(equals(value,"Is the issue present on all vehicles?"))}} + 20 {{/}}
{{#if(equals(value,"Is the issue present on all models?"))}} + 50 {{/}}
{{#if(equals(value,"Does the issue result in a model being banned?"))}} + 100 {{/}}
{{/}}
{{/}}

 

I just copied values from your example and if its not working, please try to log your values first and make sure the if conditions are evaluating correctly.. Hope it helps. Thanks!

Mat Levell August 27, 2024

@Kalyan Sattaluri This worked but I started top get into problems when I added too many questions. Is there a character limit in the simple field? When I try to put this in the advanced field I get and error saying "Error while parsing additional fields. Not valid JSON."

{{#=}}0

{{#customfield_10295}}

{{#if(equals(value,"Is the issue present on all vehicles?"))}} + 20 {{/}}

{{#if(equals(value,"Is the issue present on all models?"))}} + 50 {{/}}

{{#if(equals(value,"Does the issue result in a model being banned?"))}} + 100 {{/}}

{{#if(equals(value,”Does the issue make the vehicles effected unusable?”))}} + 50 {{/}}

{{#if(equals(value,”Does the issue happen more than once a day?”))}} + 10 {{/}}

{{#if(equals(value,”Does the issue happen more than once a run?”))}} + 20 {{/}}

{{#if(equals(value,”Is this issue blocking a performance work stream?”))}} + 50 {{/}}

{{#if(equals(value,”Is this issue blocking an internal work stream?”))}} + 50 {{/}}

{{/}}

{{/}}
Screenshot 2024-08-27 at 9.36.14 AM.png

Mat Levell August 29, 2024

@Kalyan Sattaluri sorry to ping you again but Im pretty stuck here.

 

Kalyan Sattaluri
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.
August 29, 2024

Hello @Mat Levell 

I am not aware of any limitations to the count of If statement so I would have expected it to work.

This error --. "Error while parsing additional fields. Not valid JSON." usually means something is off with syntax but scanning through your post, syntax looks correct. 

Have your tried to reduce number of if conditions 1 by 1 and check if fewer ones work? For ex, you have 8 statements now, have you tried to remove 1 and check if 7 works etc..

If lets say 5 if conditions work,  and rest of the 3 dont.. an alternative is to break up your check into multiple smaller pieces..

So, you could create a variable and assign it the first 5 checks output.

Then create another variable and add next 3/remaining to previous value..

so you could try this work around.. 

 

Mat Levell September 3, 2024

So @Kalyan Sattaluri i think I had a typo somewhere, I rebuilt each line individually and I was able to get the logic working. Thanks for your help!

Like Kalyan Sattaluri likes this
0 votes
Christopher Yen
Community Champion
August 16, 2024

Hi @Mat Levell 

Welcome to the community!

Can you try this modified statement? I'm wondering if the if block end tags are causing an issue

{{#=}}
{{#if(issue.customfield_10295.value.contains("Is the issue present on all vehicles?"))}}20{{/if}}
+
{{#if(issue.customfield_10295.value.contains("Is the issue present on all models?"))}}50{{/if}}
+
{{#if(issue.customfield_10295.value.contains("Does the issue result in a model being banned?"))}}100{{/if}}
{{/}}
Mat Levell August 16, 2024

@Christopher Yen Nope sadly no go.
Screenshot 2024-08-16 at 9.31.43 AM.png

Suggest an answer

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

Atlassian Community Events