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
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
Hi Bill, Happy New Year to you and thanks for your response. I think I tend to agree but wanted to check that I have described the scenario correctly. A value in the "IanTestSelectListMultiChoice" field can only belong to ONE category. But of course there are several different values in that "IanTestSelectListMultiChoice" field so potentially belonging to different categories.
The logic I am trying to achieve is
If Any of the Values in IanTestSelectListMultiChoice is CategoryW (highest rank) set the single value of IanTestSelectListSingleChoice to "Category W"
ELSE
if any of the Values in IanTestSelectListMultiChoice is CategoryX (2nd highest rank) set the single value of IanTestSelectListSingleChoice to "Category X"
ELSE
If any of the Values in IanTestSelectListMultiChoice is CategoryY (3rd highest rank) set the single value of IanTestSelectListSingleChoice to "Category Y"
ELSE
If any of the Values in IanTestSelectListMultiChoice is CategoryZ (lowest rank) set the single value of IanTestSelectListSingleChoice to "Category Z"
I think my approach of iterating through each of the IanTestSelectListMultiChoice fields in turn is flawed because I would need to save the highest Category rank found so far on each iteration and I can't find a way of doing that
I am going to explore if a possible approach is to merge all the IanTestSelectListMultiChoice values into one string and then use some string matching to set the appropriate category in the IanTestSelectListSingleChoice field.
In fact as I type that in that seems pretty straightforward - I think I got stuck in a dead end with my original idea and ended up spinning wheels
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In fact this is straightforward in the end just by getting all the values into a variable and then using conditional logic to test whether the string contains something and setting the category accordingly. But your reply was helpful in just steering me way from the iterative method I was trying.
The only thing I am stuck with is clearing the IanTestSelectListSingleChoice when IanTestSelectListMultiChoice is cleared. As the custom field does not appear in the list of fields to edit when I choos edit issue, I am using Advanced field editing throughout. I have tried
{ "fields": { "IanTestSelectListSingleChoice": { "value": "" } } }
{ "fields": { "IanTestSelectListSingleChoice": { "value": null } } }
{ "fields": { "IanTestSelectListSingleChoice": { "value": "None" } } } but always get the message "
Specify a valid value for IanTestSelectListSingleChoice (customfield_14414))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved that last problem by temporarily adding IanTestSelectListSingleChoice to my screen. that meant that when creating the automation, in edit Issue I could actually select the IanTestSelectListSingleChoice field rather than use Advanced field editing and I set the value to {{clear}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.