Forums

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

Confiform if statements for create new Jira Issue

SKAdmin
Contributor
May 26, 2023

None of my if statements appear to be working 

Based on a radio group with id 1 = yes, add components

  • #if(${entry.tneeded.hadId("1")}){ "component": [{"name":"A"}], #end
  • #if(${entry.sneeded.hadId("1")}){ "component": [{"name":"B"}], #end

 

Based on radio group with id 1 = project A, id 2 = Project B, set the project 

  • #if(${entry.jiraproject.id == "1"}){ "project":{"key": "PA"}}, #end
  • #if(${entry.jiraproject.id == "2"}){   "project":{"key": "PB"}}, #end

Could not prepare JSON: invalid format, not sure what I'm doing wrong. 

1 answer

1 accepted

0 votes
Answer accepted
Alex Koxaras -Relational-
Community Champion
May 26, 2023
SKAdmin
Contributor
May 26, 2023

That has gotten me closer,

project part works now with 

#if(${jiraproject.label} == 'A') "project":{"key": "PA"}, #end

#if(${jiraproject.label} == 'B')   "project":{"key": "PB"}, #end 

 

but now I get the Invalid format. Duplicate key "components"

#if(${vfxneeded.label} == 'Yes') "components": [{"name":"A"}], #end #if(${audioneeded.label} == 'Yes')  "components": [{"name":"B"}], #end

Alex Medved _ConfiForms_
Community Champion
May 27, 2023

Hi @SKAdmin 

Try this

#set( $components = '' )

#if(${vfxneeded.label} == 'Yes') #set ($components = '{"name":"A"}') #end
#if(${audioneeded.label} == 'Yes') #if($components != '') #set ($components = $components + ',') #end  #set ($components = $!{components} + '{"name":"B"}') #end

#if($components != '')
"components" : [${components}],
#end

 Alex

Like # people like this
SKAdmin
Contributor
May 30, 2023

That did the trick. Thanks Alex.

SKAdmin
Contributor
December 12, 2023

@Alex Medved _ConfiForms_ - Any reason this would suddenly stop working? 

Alex Medved _ConfiForms_
Community Champion
December 12, 2023

Hard to tell without seeing what you have. Any server logs or the configuration you can share? Feel free to open a support ticket with us, if necessary - https://wiki.vertuna.com/display/VERTUNA/Support+Request+Form

Alex

Suggest an answer

Log in or Sign up to answer