如何使用Python下载JIRA附件文件

Sur*_*ddy 1 python-3.4 python-jira

我想下载 JIRA Python 中问题的附件文件。

小智 6

我使用jira python lib,你可以使用pip install JIRA

 # -- coding: UTF-8 --
    from jira import JIRA
    import requests
    url = 'https://jira.1234.com'
    jira = JIRA(server=url, basic_auth=('admin', 'password'))
    attachment=jira.attachment(12345) #12345 is attachment_key
    image = attachment.get()
    with open("Image.png", 'wb') as f:
        f.write(image)
Run Code Online (Sandbox Code Playgroud)