Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

get the "top" priority

Deleted user March 7, 2022

I am trying to work out a query to return the "top"  (ideally through JQL, so I can get the equivalent of highest priority issue) regardless of what they have called their top priority.

 

My query at present expects the priority=Highest, but we have a customer who has set it to something else (yes, I could use the term they changed it to, but we are looking for a programmatic solution.)  what would be ideal is to be able to use sequence=1.  That does not appear to be a queryable column (might there be a way to elevate my rights to get access?).

 

Thanks!

1 answer

0 votes
Trudy Claspill
Community Champion
March 7, 2022

Hello @[deleted] 

Welcome to the community.

As per the following documentation, you can set up your JQL to search for Priority based on the ID assigned to the priority value.

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-fields/#Advancedsearchingfieldsreference-PriorityPriority

The default priorities were numbered starting with 1 for the top priority, but the priorities may have been re-ordered or custom priorities defined, so there is no guarantee that the Priority value with id=1 is in the top position for Priority ordering.

Are you querying multiple Jira instances? For a single Jira Cloud instance Priority values are a global setting, so I'm unclear on how you could have a "customer" using different values for Priority.

Deleted user March 8, 2022
My current query uses priority=Highest, and I do know about the priority id, but as it does not guarantee that ID=1 for the "top" priority. (which is true if they use Highest, or rename it, but not if they add new priorities, delete the old, etc)

The use case is a third party tool that generates reports based on issues in jira, so yes, I am connecting to multiple customer's Jira instances, not just our own.  Singular fixes (such as "just use what it is set to" doesn't work for that very reason.
My query is
createdDate >= startOfMonth(-3) and fixVersion != empty and priority=Highest order BY created DESC
I am starting to code around this issue by asking the customer to enter the priority manually (obvious problem there) when configuring their account's authentication, but I would much prefer to have the system not require that extra entry, so as to avoid typos etc.
It is also happening before the connection is established, so I cant use the API endpoint /rest/api/2/priority to obtain a list so they can choose from a dropdown.

A fun factor (that I like) is that the priority names appear to be acting like an enumeration rather than a string for comparison, so I get an error instead of just an empty result set.
{"errorMessages":["The value 'Highest' does not exist for the field 'priority'."],"warningMessages":[]}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events