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).
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{{/}}
{{/}}
Any help would be amazing.
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!
@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 {{/}}
{{/}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.