Hi All,
Can someone help me set multiple components in Jira via Confiform checkbox group?
Example:
I have a checkbox group with the following ID:Label Pairs
Say the user selects both "Apple" and "Cherry" in the form.
I want both "A" and "C" to be added as components. I know you can set components in the JSON through the following:
{ "fields": { "components" : [{"name" : "A"}] }}
But how can I set up the JSON to loop through each selection in the checkbox group to add them to components?
Hi @Shawn P
You can use asArrayOfKVPairs function from https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions
Assuming your field holding those options is named "myfield"
Then the expression would be
{ "fields": { "components" : [[entry.myfield.asArrayOfKVPairs(name)]] }}
Or if you want the label
{ "fields": { "components" : [[entry.myfield.transform(label).asArrayOfKVPairs(name)]] }}
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.