Set custom field based on calculation from another field

Rees_ Ian
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.
January 9, 2025

I have a Custom field which is a Select List MulitChoice.  The field is called "IanTestSelectListMultiChoice".   The multiple field values can each be categorized as CatA, CatB, CatC and CatD. And the Category is stored in another custom field called "IanTestSelectListSingleChoice".  The different values in the IanTestSelectListMultiChoice field each belong to one Category only (either CatA, CatB, CatC or CatD). However there is a hierarchy in the Categories cos CatA > Catb > CatC > CatD.

What I am trying to achieve is that when value changes in IanTestSelectListMultiChoice field, I want to automatically set the IanTestSelectListSingleChoice to the HIGHEST ranking category.

My thinking was to create two lookup tables - one to map Value to Category and then a second table mapping Category to a Rank value so that in a loop I can compare the Category Rank of each value and always select the highest ranked category until ultimately I can choose the highest rank category to set in the IanTestSelectListSingleChoice field .  But I have become stuck with this approach and am wondering if it is indeed possible. Any help would be much appreciated

 

Just to add, this would be possible with a complicated calculation but the mapping between value and category may occasionally change so having them in a lookup table makes it easy to modify the automation

script1.PNGlookuptable1.PNGlookuptable2.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.
January 9, 2025

Hi @Rees_ Ian 

Short answer: based on what you show, there is no solution because the first table shows a many-to-many mapping of values-to-categories, and so multiple values could be returned with the same rank-hierarchy value, but only one is possible for a single-selection field.

Slightly longer answer, assuming there is an error in the scenario description: there is no simple solution to this scenario for an automation rule, and so you could use a high-maintenance automation rule (by rethinking how the tables are used or using a logic condition) or build this outside Jira as a service which the rule could call using the Send Web Request action.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events