Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,731
Community Members
 
Community Events
185
Community Groups

how to download a attachment(excel file) which is attached to jira issue type in python?

I tried to download the excel file which is attached to jira issue type in python using requests am getting in the html format. please help me how to download the excel file which is attached to jira issue type and save it my local location. i tried like this it is saving it has html file. i need the original excel file which is attached to the jira issue.

 

r = requests.get("jiraurl", headers=headers, verify=False)

request = r.json()

excel_url = request['fields']['attachment'][0]['content'])

#output = when i run the above script am getting the url for the excel sheet were it is located, 

so i tried like this after getting the excel url am doing requests.get again for the excel url

 

r1 = requests.get(excel_url, allow_redirects=True, verify=False)

open('file.xlsx', 'wb').write(r1.content)

when i open the file it is in the html malformed format. please help me how to download the original excel file from python from a jira issue type.

 

2 answers

0 votes
ramesht shukla
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!
May 05, 2023

facing same issue

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 28, 2021
ramesht shukla
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!
May 05, 2023

not very helpful

Suggest an answer

Log in or Sign up to answer