Forums

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

Need to create values conversion in Jira automation for a Select list

Jamie Gordon
Contributor
November 17, 2023

I'm parsing out values from an e-mail created issue and populating fields in a new issue. I've created a Lookup Table and I'm using .match methods and regular expressions to extract the values from the Summary and Description fields. 

Screenshot 2023-11-17 091713.png

I'm creating a new issue and populating fields with the values from the Lookup table, like this:

Screenshot 2023-11-17 092241.png

The problem: We have a Select List field called Division. The values I'm getting from the Description in the trigger issue are slightly different than values in the Division select field. I don't have the option of changing either value at the source. So I have to do some kind of lookup and replacement.

For instance, the Division value I'm getting is 'Administrative Services', but the select list field value I need to set is 'Administration'. How can I do a static lookup and replacement to set the select list value correctly? 

I've tried making a second Lookup Table with the conversions and using a Smart Value in the .get function for the second list.

{{DivisionLookup.get({{YaypayParams.get("Division")}})}}

This doesn't work. :-(

I likely don't want to do IF/Then statements for each converted value. Yuk! Any ideas how I might elegantly achieve this? I do have ScriptRunner available to me if that helps. 

Hope this makes sense and thanks in advance.

Jamie 

 

 

 

1 answer

1 accepted

3 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2023

Hi @Jamie Gordon 

Once inside of the double-curly brackets, you do not need another set to do that lookup with get().  Please try this:

{{DivisionLookup.get(YaypayParams.get("Division"))}}

Also regarding your overall scenario, the match() function can return a list.  Are you ever expecting any of the values in your first lookup table, YaypayParams, to return multiple values as a result of matches?

Kind regards,
Bill

Jamie Gordon
Contributor
November 17, 2023

Beautiful! Thanks so much. I figured is was something simple. :-)

Like Bill Sheboy likes this
Jamie Gordon
Contributor
November 17, 2023

There will never be multiple values, at least so I'm told. Thanks again. 

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events