How to get last uploaded attachment from a JIRA issue with JIRA REST GET URI (JIRA Query Language)

Preetam I'm New Here Nov 25, 2017

Dear All,

I have two questions. If you could help me with any one of those, I would be very grateful.

1) I have few criteria to search a particular issue. Now I want to get the last updated attachment information from that issue. The issue have number of other attachments in .csv format. However, I want only the last uploaded one. Is there any function or reference keyword in the JQL to achieve the same.

2) Also could you please let me know how do I access the nested child elements of attachments and get a restricted JSON response with only intended attachments attribute.


Issue: {




  Issue Type:






self: // I want the JSON response against the GET query results me only the four attributes, id, created, content and self url.







1 answer

0 votes

In regards to part #1, there is a problem with this approach.  Jira's JQL is designed to search for Jira issues.  Meaning that JQL is designed to return Jira issues.  It's not designed to return the attachments contained within these issues natively. 

Jira's native JQL does have a "Attachments" field you can search in JQL.  But these only can be used search for whether an issue in Jira has an attachment or not.  It can't be used to search for the latest attachment on that issue.   So in regards to your first part, there is not a way to do this natively with Jira.

That said, you might be able to use a plugin in Jira to add some more of this kind of functionality.  There are a number of add-ons for Jira that extend the functionality around attachment management.  I would recommend searching our marketplace to find these:

From this list of plugins I found this one:

It appears that the use of this plugin adds new JQL functions that can extend the searching for attachments in Jira.   While this isn't exactly what I think you are looking for, this plugin would allow you to at least search specifically for attachments added between certain time periods.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot