Solved_ How to upload attachment to an Issue using the RES
Solved_ How to upload attachment to an Issue using the RES
Atlassian stands in solidarity in the fight against the oppression of Black people. Read our
×
founder blog here.
Explore
Community / Answers Developer Questions / Questions / How to upload attachment to an Issue using the REST API in Python??
I want to upload an attachment to an Issue in Jira using the Rest API. How can I do the following in
Python.
3 answers 1 accepted
# ===============
# greeting.txt
# ===============
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-upload-attachment-to-an-Issue-using-the-REST-API-in/qaq-p/464045 1/5
6/10/2020 Solved: How to upload attachment to an Issue using the RES...
hello, world
# ===============
# upload.attachment.py
# ===============
import requests
import json
If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing
the same issue you have inquired.
Kind regards,
Rafael P. Sperafico
Atlassian Support
Nathaniel Miller
Aug 16, 2019
Great post, made the difference for my efforts. The one thing I would mention is that at least for me (2019, Python2,
CentOS 7) I had to do the following for the authentication to work:
credentials = requests.auth.HTTPBasicAuth('[USERNAME]','[PASSWORD]')
r = requests.post(url, auth=credentials, files=files, headers=headers)
Like
Reply
1vote
Rodrigo Silva
Aug 10, 2015
Hi Jagruthi,
I believe the answer you are looking for might be related on this article:
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-upload-attachment-to-an-Issue-using-the-REST-API-in/qaq-p/464045 2/5
6/10/2020 Solved: How to upload attachment to an Issue using the RES...
https://docs.atlassian.com/jira/REST/6.2/#d2e2310
Cheers,
Rodrigo Silva
Jagruthi k
Aug 10, 2015
Like
Reply
0votes
http://stackoverflow.com/questions/2667509/curl-alternative-in-python
https://confluence.atlassian.com/display/JIRA061/How+to+attach+an+attachment+in+a+JIRA+issue+using+REST
+API
https://confluence.atlassian.com/display/JIRAKB/Bulk+import+attachments+to+JIRA+issues+via+REST+API
Kind regards,
Jaime Kirch da Silveira
Atlassian Cloud Support
Reply
TAGS
Cannot update Jira issue fields via REST API (in P...
COMMUNITY SHOWCASE
Ben_Thoma
Published in Training & Certification
144 views 3 10
Read article
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-upload-attachment-to-an-Issue-using-the-REST-API-in/qaq-p/464045 4/5
6/10/2020 Solved: How to upload attachment to an Issue using the RES...
Community Events
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-upload-attachment-to-an-Issue-using-the-REST-API-in/qaq-p/464045 5/5