You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi there!
I have a field in my JIRA issues which is basically a set of comma separated numbers (with max 999). Im looking to find a way to iterate through them using the various automation functions and select the lowest of them. I cant seem to grasp how to use the # operator and the list functions to do this. So effectively I want to do the equivalent of this pseudocode
int lowest = 1000
for (int i =0 i< list.length(); i++) {
if (list.get(i) < lowest {
lowest=list.get(i)
}
}
I'd really appreciate any tips on how to attack this problem
Thanks in advance!
Chris
You can use the MIN() function in JQL to find the lowest number in a list. For example, if you have a field called "numbers" with a list of comma-separated numbers, you can use the following query to find the lowest number: MIN(numbers) Keep in mind that Jira rounds decimals to the nearest 1000th place, and people can enter large numbers using scientific notation.
Hi @Chris Smith
This is can be done quite simply with some of the smart value functions available in Jira automation.
In your case, the following smart functions will achieve your outcome:
{{description.split(",").min}}
I used the description field, so just replace that with your actual field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow. That was easy - thanks for answering Gareth. I feel a bit stupid now :-) Do see a way to extend this to reordering the whole list?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, there is currently no option to sort lists.
I believe there are some feature requests for this which you could vote for.
You can search through these projects on JAC, depending on which platform you're on: https://jira.atlassian.com/projects?selectedCategory=all&selectedProjectType=all&contains=automation&sortColumn=name&sortOrder=ascending&s=view_projects
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.