Confiform if statements for create new Jira Issue

SKAdmin 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2023
SKAdmin 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_
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.
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 May 30, 2023

That did the trick. Thanks Alex.

SKAdmin December 12, 2023

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

Alex Medved _ConfiForms_
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.
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