Hi Experts,
Need your help in setting up an automation rule.
Problem Statement:
We have a multi-select field where each option has a ranking or score stored in a lookup table.
For example:
Client 1: 100
Client 2: 200
Client 3: 300
If multiple values are selected in the multi-select field, we want to pick the option with the highest score.
Example:
If Client 1 and Client 2 are selected, the smart value should return 200.
I am not able to find a way to pick the highest value from the lookup table.
Kindly suggest a solution.
Hello @Vikrant Yadav
For me, if we have fewer than 10 values of client name to manage, we can user if / else conditions.
I will start with the condition for the highest-priority value (for example, Client 10).
Then, as an action, I will use: {{tablename.get("Client 10")}}
If that condition is not met, I will go down step by step to the next client (Client 9, Client 8, etc.) until the lowest one, and for each match I will return the corresponding value from the lookup table.
:)
Hi @Duc Thang TRAN
Thanks for your suggestion!
But here it's multi-select field having 8 options
how you decide which option to pick when three option selected in a field ?
Out of these three options, we need to select the value from lookup table which have highest ranking out of these three.
Is any other way to do this, other than lookup table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is why I suggest using if / else conditions.
For example, if we have the following matrix:
Client 1 → 100
Client 2 → 200
Client 3 → 300
We start with the highest value in the matrix.
First condition:
Work item field condition → Client name contains any of Client 3 (highest value)
Then action:
{{tablename.get("Client 3")}}
This means that if the ticket contains multiple values and one of them is Client 3, it will automatically be considered as the highest value.
Then in the else:
Check if it contains Client 2
→ {{tablename.get("Client 2")}}
Then in the next else:
Check if it contains Client 1
→ {{tablename.get("Client 1")}}
This is a manual ranking, not a variable
That is why I think it is easy to manage when we have fewer than 10 values.
We could even simplify it further by not using a lookup table at all and directly mapping the values in the actions (for example, setting 300, 200, or 100 directly).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Short answer: you could solve this using dynamic list searching methods.
To get the maximum score, the solution approach is:
To learn more about this method, please see this article I wrote on it.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy Thanks for the solution!
I'll try your solution as well. Let me setup flow and get back to you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lets approach this theoretically.
Don't use a lookup table.
What if you have a custom select field with just number options like 1, 2 and 3 .
Create a work item with multiple values in customfield_xxxxx
Then in the automation use {{issue.customfield_xxxx.max}}
Add this to a log action, what is the result?
If this this is 2 ( if option 1 and 2 where used)
The you could use this value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc -Devoteam-
Custom Field options are Client Names.
It's not a number options. In Lookup table i am giving score to each Client.
From lookup table we'll get which Client have high score.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vikrant Yadav,
Unfortunately, Jira Automation does not natively support retrieving the maximum value from a lookup table for a multi-select field.
To achieve this, you would need to use a Marketplace app like ScriptRunner to script the logic, or manually create conditional smart values for each option, but there is no built-in function to automatically pick the highest score.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.