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.
in excel i have a column that has 2 values separated by a comma. How do i return the max value in that field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in powerbi i have a column that has text in in and I need to remove it. how do i do that
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.