Need help on attaching the file while creating the defect in JIRA using REST API

Lokesh Sharma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 9, 2019

Hi All,

We have to explore the defects in JIRA.  We are able to consume the REST API shared by JIRA. defects are also getting logged. However, our requirement is to attach the file while exporting the issues to JIRA through REST API. However, based on the documentation, it seems that there is no provision for attaching the doc through REST API for Jira. Would like to confirm this. Is this really the case or please suggest how we can achieve this?

 

 

Regards,

Lokesh.

 

 

1 answer

0 votes
Warren
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.
December 9, 2019

Hi @Lokesh Sharma 

I'm not sure where you got that information from, but I regularly use Jira's REST API to attach documents (images, PDFs, Word docs, Excel spreadsheets) to a ticket. The point to note is you can't do it at the same time as creating the ticket, so I use the API to create a ticket, which returns the key (ABC-123). I then use this key and another API call (POST) to attach document(s).

See the answer from Jeff Caron here for a C# implementation which is what I've used so I know that it works.

Suggest an answer

Log in or Sign up to answer