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

Downloading an attachment from a jira issue using jira-python

So, 

I am trying to download a file from JIRA ticket using jira-python, but I did find any userful information for that. 

Has anybody done it so far ? 

--Ishan

2 answers

Try something like this:

issue = jira.issue('JCD-6585')
attachment = issue.fields.attachment[0]
image = attachment.get()
with open('/tmp/Issue1_CA_JCD_6585.png', 'wb') as f:
    f.write(image)

 

For me I found that you have to also ask for expanding attachment in order for this to work.

issue = jira.issue('JCD-6585', expand="attachment")
...

I do not you Pyton at all, just read documentation. Have you tried to use 

attachment(id)[source] 

Get an attachment Resource from the server for the specified ID?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

We want to hear from you! How do you use Slack and Atlassian together?

Hi Everyone! My name is Mina and I am on Atlassian’s Ecosystems Marketing team. Our team is focused on our technology partnerships and marketplace apps. One of Atlassian’s partners is Slack, who ...

24 views 0 2
Join discussion

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