I don't have a lot of control of my confluence configuration and i am not a web developer by trade. so forgive me if i am butchering the definitions.
Im trying to use a confiform to create a JIRA issues
i wanted to use velocity code to help "build an array of labels to add to an issue
But i have had zero luck with using velocity variables in my enviroment.
{ "fields":{
"project":{"key":"somekey"},
"issuetype":{"name":"Software Design"},
"priority":{"name":"Medium"},
"components":[{"name":"[entry.ClassSelector.escapeJSON]"}],
"description":"[entry.issueDetails.escapeJSON]",
#if ("[entry.valueSeverity.escapeJSON]" != "")
"customfield_11853":{"value":"[entry.valueSeverity.escapeJSON]"},
#end
#if([entry.IsShipCheckReq] == true)
#set( $labelStr = "ShipCheckReq," )
#end
#if([entry.IsDiscrep] == true)
#set( $labelStr = "$labelStr discrep," )
#end
#if([entry.IsSafetyCritical] == true)
#set( $labelStr = "$labelStr Safety," )
#end
#if([entry.isFleetsupport] == true)
#set( $labelStr = "$labelStr FleetSupport," )
#end
#if([entry.isTask] == true)
#set( $labelStr = "$labelStr Task," )
#end
#set( $labelStr = "$labelStr""formGenerated""" )
"labels":["$labelStr"],
"summary":"[entry.issueName.escapeJSON]" }
}
Hi
Please see this page on how you actually mix the Velocity with ConfiForms Field value references https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-CreateJiraIssue
Especially how to check if the value is given or not.
Alex
thanks for the response.
I think if i knew what i was doing that page would be helpful, but i don't so it wasn't.
i wound up solving this by redoing the page as replacing check boxes with a multi select label box.
I guess i have another question?
Is it possible to build a string like i was attempting and pass it in as an array of labels?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Consider the following template (I have 3 fields of type checkbox and I am checking their "RAW" value, as described in our docs)
And the template itself
#set ($labelStr = "")
#if(${check1})
#set ($labelStr = $labelStr + "Check1, ")
#end
#if(${check2})
#set ($labelStr = $labelStr + "Check2,")
#end
#if(${check3})
#set ($labelStr = $labelStr + "Check3,")
#end
{ "fields": { "project": { "key": "somekey" }, "issuetype": { "name": "Software Design" }, "priority": { "name": "Medium" }, "components": [ { "name": "[entry.ClassSelector.escapeJSON]" } ], "description": "[entry.issueDetails.escapeJSON]", "labels": [ "$labelStr" ], "summary": "[entry.issueName.escapeJSON]" }
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.