Forums

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

automation for jira if conditional logic not valid

SKAdmin
Contributor
March 16, 2023

Any suggestions how to fix the JSON - Additional fields for multiple if statements.

Clone issue - set fix version based on severity(custom field 10725)

 

Clone issue

Error while parsing additional fields. Not valid JSON.

{
"fields": {
"fixVersions": [ {
"name":
{{#if(equals(customfield_10725.value, "1 - Critical"))}}
1_0_1 - Day 1 Patch
{{/}}
{{#if(equals(customfield_10725.value, "2 - Major"))}}
1_0_1 - Day 1 Patch
{{/}}
{{#if(equals(customfield_10725.value, "3 - Minor"))}}
1_1_0 - Season 1
{{/}}
{{#if(equals(customfield_10725.value, "4 - Trivial"))}}
1_1_0 - Season 1
{{/}}
{{#if(equals(customfield_10725.value, " None"))}}
1_1_0 - Season 1
{{/}}
}]
}
}

1 answer

0 votes
Darryl Lee
Community Champion
March 19, 2023

Hi @SKAdmin - I think your values for fixVersions need to be enclosed in double quotes, like:

"1_0_1 - Day 1 Patch"

ALSO - when I've tried to do advanced editing with JSON in the past, despite it making it impossible to read, I've had to sometimes remove the linefeeds, so your name value would end up looking like this:

{{#if(equals(customfield_10725.value, "1 - Critical"))}}"1_0_1 - Day 1 Patch"{{/}}{{#if(equals(customfield_10725.value, "2 - Major"))}}"1_0_1 - Day 1 Patch"{{/}}{{#if(equals(customfield_10725.value, "3 - Minor"))}}"1_1_0 - Season 1"{{/}}{{#if(equals(customfield_10725.value, "4 - Trivial"))}}"1_1_0 - Season 1"{{/}}{{#if(equals(customfield_10725.value, " None"))}}"1_1_0 - Season 1"{{/}}

(I did NOT add spaces there. I in fact removed all spaces.)

SKAdmin
Contributor
March 30, 2023

I'll give that a try and see if works. Thank you for the suggestion. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.3
TAGS
AUG Leaders

Atlassian Community Events