Hello,
I am trying to update a field ( for example fields status), using the POST method from Python.
I followed the documentation but when i check the result the status of issue doesn't changed.
Here is the code I try to run:
in this example I want to change status to "Request Info" with:
import requests
from requests.auth import HTTPBasicAuth
import json
auth = ('myuser', 'mypassword!')
# set the url
url = "myorganizationurl/rest/api/2/issue/SF-6831/transitions"
# simulating that the transition id will be status : TO DO
data = {"transition": {"id": 331}}
#make the authenticated request to the JIRA API
r = requests.post(url, auth=auth, json=data)
print ("HERE's the JSON RESPONSE\n\n ", r.status_code, r.headers)
would be great if you can guide my through on how to update not only this field but also ( comments, fix version, Reporter, Description ,Priority ,Team...)
Thanks.
Welcome to the Atlassian Community!
There's a lot in here, bur to start with the basics:
import requests
from requests.auth import HTTPBasicAuth
import json
HERE's the JSON RESPONSE
400 {'X-AREQUESTID': '747x3930128x1', 'X-ANODEID': 'valor-node1', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Security-Policy': 'sandbox', 'Strict-Transport-Security': 'max-age=31536000, max-age=31536000; includeSubDomains; preload', 'Set-Cookie': 'JSESSIONID='my organozation url~9E7BDB018BA8A606191943CB4B0548D6; Path=/; Secure; HttpOnly; Secure, atlassian.xsrf.token={token number}dfe3eee6863338a274543_lin; Path=/; Secure; SameSite=None; Secure', 'X-Seraph-LoginReason': 'OK', 'X-ASESSIONID': '19m10vv', 'X-AUSERNAME': 'muuser', 'Cache-Control': 'no-cache, no-store, no-transform', 'Content-Encoding': 'gzip', 'Vary': 'User-Agent', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Date': 'Fri, 14 Oct 2022 11:27:27 GMT'}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Umm, that's not a response, that's a response header.
If you've hit a Jira REST endpoint, it will have given you a success or failure response, with some detail on what it has done or what went wrong. If you've tried to hit an invalid one, the response would say that it's not valid.
We need to know what the content of the response is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.