I am trying to add attachment to JIRA cards using JIRA API, I’m referring below document for addAttachment API.
Headers as below:
Request param: file=@C:/Program Files/CA/DevTest/Projects/CHARMR3_API/Tests/Results/get_hier_01_2018-07-05_negative.html
Content Type: multipart/form-data; boundary=--gc0p4Jq0M2Yt08jU534c0p
As expected API is returning 200 response code but no attachment added to JIRA card. No JSON response as well.
May be the boundary value I gave in contentType could be wrong. Attached is the HTML file needs to be attached, can anyone please suggest the solution?
I am able to perform few other updates using JIRA APIs mentioned in above shared link.
How does CA DevTest relate your trial with JIRA cards? Do you use REST Invoke API in DevTest?We can only find the location of "Request param"'s file seems DevTest installation path.What version of DevTest are you using?Could you please give us the detail information?
I am using DevTest 18.104.22.168.
Yes I am using REST invoke API.
Hi, have got the solution to upload file using JIRA API from LISA now. But the file is getting uploaded without content and size is 0. Not sure if need to make any config chnages. below is the request I am sending:
POST /rest/api/latest/issue/CHARM-6654/attachments HTTP/1.1Pragma: no-cacheCache-Control: no-cacheX-Atlassian-Token: nochecklisaFrameRemoteIP: 10.45.186.127lisaFrameRoot: truelisaFrameID: 1d3b8330-96fa-11e8-b0ca-323920524153Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="file"; filename="get_grp_03_2018-07-03.html"; Content-Type: text/html
same config is uploading file properly when triggered from postman i.e. uploaded with content
Anyone having suggestions?
Thank you for the information.How do you send POST request to JIRA API?
PFA screenshot of DEVTEST JIRA REST step config.
I have mentioned above how to send POST request to JIRA API.
The Jira Cloud platform REST API is the link I am referring
Please try "HTTP/HTML request step" on behalf of "REST step" and set the "Host Name:", "Port:", "User:", "Password:" and "Path:"Then add one post parameter which is suitable JIRA API
And change the "Form Encoding:" as "multipart/form-data; boundary=----".
I do not have the access for JIRA and JIRA REST API but I tried REST API in DevTest which would deploy .mar file to VSE and I could deploy the .mar file.Here is the screenshot of the "HTTP/HTML request step" in my trial.
My trial and this screenshot may help you.