Forums

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

How to set a list field without having to match the correct casing

David Moreno
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 28, 2021

Hi all, I'm using automation to process subjects on incoming emails and set multiple values on a ticket from it. Everything works great as long as the email is typed with the proper casing eg: "David Moreno".

{
"update":
{
"Name":
[
{
"set": {"value": "{{issue.summary.replaceAll("(?i)^.*check([1-9])+\.([^\.]+)\.([^\.]+)\.([^\.]+)$","$4")}}" }
}
]
}
}

On my list fields, if I try to set a field, and the email comes like this "David moreno", it will fail because that is not considered a valid value for the list field.

First Question: is there any way to make the list (combo) fields case insensitive?, so I can set up the same value with any casing.

If not:

Second Question: I have been trying to capitalize the input coming in, but in smart values, when I split the incoming string by space, I haven't been able to apply a string function like capitalize() to the list of split strings, there is probably an easier way:

{{#
issue.summary.replaceAll
("(?i)^.*check([1-9])+\.([^\.]+)\.([^\.]+)\.([^\.]+)$","$4").split(" ")
}} {{.}}) {{/}}

 

I cannot change the field values (over 1300 in there).

 

Any help will be appreciated.

 

Regards

 

1 answer

1 accepted

0 votes
Answer accepted
David Moreno
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 30, 2021

Never mind, I figured it out:

Capitalize at the end of the array split, will apply it to all elements.

{{#
issue.summary.replaceAll
("(?i)^.*check([1-9])+\.([^\.]+)\.([^\.]+)\.([^\.]+)$","$4").split(" ").capitalize()
}} {{.}}) {{/}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events