How do I retrieve a particular amount of tickets ?

Charles Bovalis March 29, 2022

Example:  I need to find out the last 3 deployments for a particular service.  

My JQL would look something like this: 

project = GPROD AND issuetype = Logbook and "service name" = service-name
ORDER BY created DESC AND ( ?? display only 3 tickets ?? ) 

I am looking for the last part of this query - to be able to retrieve a particular number of tickets 

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2022

Hi @Charles Bovalis 

Short answer: no, that is not possible.

Longer answer: JQL is not a SQL, and so does not have most basic features of a SQL.  Depending upon why/how you need the first 3 (or first N), you could create a dashboard with a issue filter gadget and try to limit the results or investigate marketplace addons for purchase to extend JQL features.

If you needed this for some type of reporting, you could use an automation rule to limit the result set, and send an email, post to Slack/Teams, etc. with just the first-N items.

Kind regards,
Bill

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2022

one question - what is significant about "the last three"? The only reason I ask is that if, for instance, you could leverage a date rather than the number of issues then you could work a date into your JQL.

Like # people like this
Charles Bovalis August 26, 2022

Thank you all for your feedbacks. 

I eventually resorted to use Python for-loop along with a max_results counter variable to control how many answers to get. 

Jack - the reason for getting the top 3 incidents of a particular service was because this is what they asked me to deliver. A service could potentially have several SEV incidents over time so they only wanted to see the last 3 incidents for a particular service. 

Suggest an answer

Log in or Sign up to answer