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

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 Sign up to answer
Community showcase
Published Thursday in Jira

Updates to give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

468 views 1 14
Read article

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