I'm trying to attach photo to task using requests:
headers = {'X-Atlassian-Token': 'no-check', 'Authorization': 'Basic %s' % user_token, 'Content-Type': 'application/json'}files = {'media': open(path_to_file, 'rb')}url = "https://{}/rest/api/2/issue/{}/attachments".format(host, task_key)result_attach = requests.post(url, files=files, headers=headers)
But I get reponse 415
415 seems weird since you're choosing a content type... Try removing the single quotes around 'no-check'. Or maybe try passing the header as a whole string?
No, this part is ok
It looks like you're new here. Sign in or register to get started.