Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I'm trying to add An attachment to an Issue with Rest Api but it returns []

Hi,

I have a project in Jira Cloud, I'm trying to do a Post Rest API to ad an attachment to an Issue(the issue is present in the jira cloud project) but It return []

I'm using MobaXterm to Call the Api. this is the Curl i'm using:

D- -X POST -H "Authorization: Basic XXX==" -H "X-Atlassian-Token: no-check" -F "file=C:\Users\X\X\X\X\X@name_of_the_attachment.csv" https://xxx.atlassian.net/rest/api/3/issue/FWT-307/attachments

 

This is the entire response I got:

HTTP/1.1 200 OK
Server: AtlassianProxy/1.15.8.1
vary: Accept-Encoding
cache-control: no-cache, no-store, no-transform
Content-Type: application/json;charset=UTF-8
Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
Date: Wed, 20 Jan 2021 14:38:15 GMT
ATL-TraceId: 5ba6903f5ee805ee
x-arequestid: XXXXXX
x-aaccountid: XXXXXX
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
timing-allow-origin: *
x-envoy-upstream-service-time: 101
X-Content-Type-Options: nosniff
micros-issuer: micros/edge-authenticator
Connection: keep-alive
set-cookie: atlassian.xsrf.token=06039861-b71d-4c38-9150-4fb125074da3_ec11b2a553989320f6e1e4a9b6c2eb3d04170713_lin; Path=/; Secure
Expect-CT: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400

[]

 

 

 

Where is the error? is in the Curl? how to change it?

 

Thanks

 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Riccardo Micozzi,

Don't have a Jira Cloud instance, so I couldn't try this. Please try the following cURL command:

curl -D- -u email@example.com:<api_token> -X POST -H "X-Atlassian-Token: no-check" -F "file=@C:\Users\X\X\X\X\X\name_of_the_attachment.csv" https://your-domain.atlassian.net/rest/api/3/issue/TEST-123/attachments

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

168 views 6 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you