Hi All,
I want to Integrate JIRA with third party application. I can create JIRA issue successfully without any attachment by using following JSON.
{ "fields": { "project": { "id": "10000" }, "summary": "No REST for the Wicked.", "description": "Creating of an issue using ids for projects and issue types using the REST API", "issuetype": { "id": "3" } } }
Third party application simply post the JSON to JIRA and its creates the Issue. I want to know JSON format for create issue with attachment.
Note : Am not using CURL. Only posting JSON data from third party application which supports REST API to JIRA.
Thanks
Eswaran
Community moderators have prevented the ability to post new answers.
The attachments API method does not support JSON. It expects a multipart post.
I managed to use it with PostMan.
Header must contain:
Content-Type: multipart/form-data
X-Atlassian-Token: no-check
Body must be of type "form-data" and must contain a key named "file" with value a specified file (I had to use the file picker, see the picture).
Similar question has been posted in https://answers.atlassian.com/questions/249347. Since REST does not care what do you use to communicate with it as long as it is properly formatted, it will always work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabrielle, Thanks for your reply. But the third party application will accept only JSON input to perform JIRA operation. I can create Issue in JIRA by passing above JSON in that third party application. likewise, Is there any JSON format to attach a file in JIRA?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, take a look at this documentation. It's as simple as the command below. No JSON body needed curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" http://myhost/rest/api/2/issue/TEST-123/attachments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabrielle,
For testing purpose, am using Chrome Extension "Insomnia" which is used to call the REST service.
REST.jpg
Here, Body and Params both are empty. Why am getting 415-Unsupported Media Type Error ? Where should I include the file=@filename.txt option here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eswaran,
Did you solved this issue using JSON format? I am facing similar issue in my project. Please help me here to upload attachement with JSON format. Currently i am developing this with node.js
Thanks is advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need the same solution. I am using Oracle Apex. It would be easier using just the JSON format instead of curl command.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.