Hi -
Below is the documentation I see for 'POST request to upload attachment'. Is there a groovy code, that is available for 'upload attachment' ?
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post
Hi @Reeja Mathews welcome to the community. There is groovy code to achieve this and it is used within plugins such as Scriptrunner or Groovy for Jira. Do you have any of these plugins available to you?
Yes, I tried the below. It says 200, but doesn't really attach anything to Jira, any idea where I might be going wrong ?
// ------- CODE --------
def args = [httpMode : 'POST',url : "https://<url name>/rest/api/2/issue/PEQT-234/attachments",customHeaders: [[maskValue: true, name: 'Authorization', value: "Basic xyz="],[maskValue: false, name: 'X-Atlassian-Token', value: "no-check"],[maskValue: false, name: 'Content-Type', value: "multipart/form-data"]],uploadFile : 'README.md',wrapAsMultipart : true,multipartName : 'README.md']httpRequest args
I tried with content-type as 'application_json' too, but doesn't do an upload properly
fyi - masked the url name and the basic authorization
Hi all, any update to this question..
hi @Craig Nodwell Please let me know where I could be going wrong, when you get a chance.
It looks like you're new here. Sign in or register to get started.