Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira API To Add Attachment To Issue Using RestSharp

bigdata_demo
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!
February 18, 2020

Hi Team,

 

I am able to create a ticket in JIRA without issue; however when trying to attach files to tickets -  i am facing issue.

 

Issue is: i am able to trigger Api request "issue/"+ jiraticketnumber + "/attachments" and getting a response as OK with response content as blank and could not see the attachment within the JIRA ticket.

Headers.Add("X-Atlassian-Token", "nocheck")

string[] Attachments = { @"excel.xlsx", @"Image.bmp", @"Text.txt"};

foreach (string file in Attachments)
{
request.AddFileBytes(file, File.ReadAllBytes(file), file,"application/octet-stream");
}

Can you let me know whether this is any permission issue or something literally going wrong from my side.

 

regard

 

Ram

0 answers

Suggest an answer

Log in or Sign up to answer