Hi,
I have a Microsoft Form that creates a ticket in Jira. From there I have an automation set up to grab the data from the issue description and place it in various custom fields. I have no issues setting the values to date picker and single-line/paragraph custom fields, the only issue is with single select fields.
I'm using the .match() smart-value function to accomplish this.
Example of the issue Description:
First Name: John
Last Name: Smith
Company: Smith & John, LLC.
Example of a value in the Automation for the custom field, First Name:
{{issue.description.match("^First Name: *(.*)")}}
The above works fine because it's updating a text field. When I try the same concept for a single-select field it doesn't do anything and automation has an error. I tried the JSON below.
{
"fields": {
"customfield_11299": {"value": "{{issue.description.match("^Company: *(.*)")}}"}
}
}
But I get the error, "(Specify a valid value for Company (customfield_11299))"
I've even tried,
{
"fields": {
"customfield_11299": {"value": "{{issue.description.match("^Company: *(.*)").toJsonString}}"}
}
}
Then I get an error, "Invalid JSON".
Please help!
Make sure you add .trim() to your smart value, I had a similar issue where the field was not set even though the audit log showed that the value was correct. After I added .trim() everything worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Izquierdo , it would be interesting to add a log action to capture the 'value' of Company to see if it matches that of available single select options. If that proves successful I might try using a Variable action to store the value and then use the variable in the edit action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Jack Brickey ! Log action captured the 'value' which matched the single select option. I'm now able to get it to enter the value into the custom field (after add the .trim(), thank you @Mikael Sandberg ).
For reasons we're not using the Jira form (waiting to fully setup Refined since it looks nicer) and not being able to do this was going to add too much manual work for our HR team. Probably TMI but, we're configuring our Onboarding Process in Jira which interacts with 12 different departments and without this I was just adding all the information formatted neatly in a comment for HR to manually update the custom fields - which would not be a fun time for them.
I do have another question, similar issue. How would I select the options for a multi-select custom field from the description? Below is an example of what the 'value' looks like in the description.
["dual monitors","docking station","keyboard","mouse"]
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.