Automation question: how can I extract the id of the selection of a single select custom field?

Mark Hanson May 12, 2021

We want to compare the selections in two single select custom fields by extracting the id's of the selections and then taking action depending on what the numeric difference between the two numbers is. 

Example:

Field A options are Apple, Berry, Cherry, Dog and the selection is "Dog".
Field B options are the same and the selection is "Berry".

The difference between the option ID's should be 2

The discussion in the automation documentation covers obtaining the value corresponding to an index, but not the reverse.

Any suggestions?

1 answer

1 accepted

1 vote
Answer accepted
wwalser
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2021

{{issue.field name.id}}

Here is a visual example of how to experiment and test things like this in the future:

Screen Shot 2021-05-13 at 11.52.11 am.png

Screen Shot 2021-05-13 at 11.52.18 am.png

Mark Hanson May 14, 2021

Thank you!

That does solve it for me; however, it is giving me the relative position in the list only if I use math to subtract the first item's id from all the results, making it cumbersome.

Is there a way to access the relative position of the selected item?

wwalser
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2021

Unfortunately no, Automation does not have a way to understand relative position within select boxes.

Mark Hanson May 17, 2021

OK

Suggest an answer

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

Atlassian Community Events