Forums

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

How to split labels from the output of ConfiForms Field that is in  [A,B,C,D] format

yogesh bhatt April 20, 2023

I'd like to be able to select 1 or more metrics from a multiselect confiform dropdown and when the form creates a jira story, it should automatically add the corresponding label for each of the metrics selected to the label field in the story.

 I am using "Smart Multi-select" field type in ConfiForms field.

 The output from that is in  [A,B,C,D] format. JIRA considers it one label rather than seperate. I want these 4 labels gets created? how to do that I used array keyword as well.

{ "fields": { "project": {"key": "SATS"}, "summary": "[entry.Summary.escapeJSON]", "description": "Issue: [entry.Issue.escapeJSON] \r\n \r\n Requester: [entry.Requestor.escapeJSON] \r\n \r\n Tech contact: [entry.Techcontact.escapeJSON] \r\n \r\n Metric(s): [entry.Metrics.LinkedMetricSep.escapeJSON] \r\n \r\n Metric Label(s): [entry.Metrics.MetricLabelSep.escapeJSON] \r\n \r\n Benefits: [entry.Benefits.escapeJSON] \r\n \r\n Workaround: [entry.Current.escapeJSON] \r\n \r\n To Be: [entry.ToBe.escapeJSON] \r\n \r\n Additional Comments: [entry.Comments.escapeJSON]", "labels": ["Dynamos"], "customfield_10153": "[entry.Summary.escapeJSON]", "duedate": "[entry.DeployDate.jiraDate]", "reporter": {"name": "[entry._user]"}, "issuetype": {"id": "5"}, } }

 

1 answer

0 votes
Alex Medved _ConfiForms_
Community Champion
April 21, 2023

Hi

Is this the expression in question? 

[entry.Metrics.MetricLabelSep.escapeJSON] 

Alex

yogesh bhatt April 22, 2023

Yes Alex. I want to seperate the lebels. As of now it's coming in format (A,B,C,D) and its getting as one label, I tried removing seperater comma but with space also it considers one label itself.

Alex Medved _ConfiForms_
Community Champion
April 23, 2023

Although, I dont know your form's configuration but I believe this is what it should be

[entry.Metrics.transform(MetricLabelSep).asArray]

Alex

yogesh bhatt April 26, 2023

error.PNG

We are getting this error Alex. Could you let us know what is wrong here?

Alex Medved _ConfiForms_
Community Champion
April 26, 2023

Try

[entry.Metrics.transform(MetricLabelSep).asArray.escapeJSON]

Alex 

yogesh bhatt April 26, 2023

No that didn't help. We tried trimAllSpaces today and it is working now.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events