I would like to automate filling in a custom field which has a drop-down list of allowed entries.

Cristin Williams
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!
October 25, 2023

We have a rule in place to create Jiras when certain conditions are met. I would like to add a rule to automatically fill in one of the custom fields which has a drop-down list of allowed values.

What I have so far:
1. Action to create smart variable from a specific part of the issue.summary string.

2. Conditional rule to check whether a certain string is found in the issue.summary

=> If condition is met, default my custom field to a specific value from the drop-down. 

3. For the "Else" condition, I want to compare the value of my smart variable to the drop-down list for that field. 

=> If this condition is met, default custom field to matching value.

=> else, leave field blank.

The first 2 parts (create smart variable & set condition to choose a specific value) seem straightforward. But I'm not clear how to compare my smart variable to the drop-down list. Can someone supply recommendations, or am I on the wrong path here? Am I going to have to replicate my drop-down list in JSON?


Screenshot 2023-10-25 154320.pngScreenshot 2023-10-25 154047.png

1 answer

0 votes
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.
October 25, 2023

Hi @Cristin Williams -- Welcome to the Atlassian Community!

Just to confirm, are you trying to...Compare something in the trigger issue to a list of allowable values, which is already used in a selection field?

If so, you have a couple of options:

  1. hard-code the values in the rule to compare (with conditions, a lookup table, etc.), or
  2. call the REST API functions to get the possible values for comparison.

You may want to try option #1 initially to confirm the values from the Summary extraction and selection field match as expected.

And something I just noticed...When using things like Create Variable, Lookup Table, and Advanced Branches, it is a good idea to use names which are unique and cannot be confused with a smart value (e.g., Model and model).  I like to add a prefix to avoid smart value collisions, such as varModel.

Kind regards,
Bill

Cristin Williams
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!
October 25, 2023

Hi @Bill Sheboy. Yes, correct. I want to compare the value of the smart variable created in my first action to the list already available in a selectionfield.

It's quite a long list, which is why I wasn't in a hurry to have to hard code it as a table if avoidable. I could hard-code a few options as as a test. I haven't gotten into REST API functions, so will go learn more about that option.

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