Multiple if-statements

jorgen_nordahl February 6, 2025

Hi!

We have a workflow:

  1. Emails come in and gets handled by out email handler in email this issue
  2. Email this issue populates certain custom fields in Jira through regex.
  3. One of the fields is called country_string, which are country codes like US, AU, NZ, etc.
  4. In the end of the workflow there is a very simple automation that looks like this:
    1. If country_string equals AU
    2. Edit issue field Country to Australia

Problem:

Issue field Country is a dropdown menu with fixed values. 

I don't like this way of doing it. We have a lot of countries, which leads to a veeeery long and stupid list of IF's.

 

Question:

Any suggestion on a better way of doing this? I've been looking a little into lookup tables, but I'm not sure I understand how they work. 

 

Thanks!

1 answer

0 votes
Laura Humphries February 6, 2025

Regarding lookup tables and how they work, you would have a table where one column contains the key, in your case it would be the values of country_string. The second column would map that key to the actual name of the country, Australia in this instance.

So you'd have a table that looks up the key and and maps it to the corresponding value. The result of the lookup would be used to populate your custom field.

I do wonder, why you are populating a custom field with the country code and then populating a country field based on that code? Do you need both sets of data or could you not reduce it down to a single country field? Just curious.

Suggest an answer

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

Atlassian Community Events