Hi community,
I need to update the following jira property in my tickets:
"fields" : {"customfield_15035": [{"prop1": "xxxx", "prop2": "yyyy", "prop3": "zzzz"}]}
I tried to use the documentation code for Python, but I have not been able to adapt it.
Can someone please advice? How to change the customer field?, via payload?
Thanks
import requests
from requests.auth import HTTPBasicAuth
import json url = "https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey}"
auth = HTTPBasicAuth("email@example.com", "<api_token>")
headers = { "Accept": "application/json", "Content-Type": "application/json" }
payload = json.dumps( {} )
response = requests.request( "PUT", url, data=payload, headers=headers, auth=auth )
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
Hi,
I was able to update my custom_field with the following code:
import requests
import json
from requests.auth import HTTPBasicAuth
url = "https://your-domain.atlassian.net/rest/api/2/issue/{issue_key}"
issue_key = "TEST-55"
auth = HTTPBasicAuth(user, passw)
payload = {
"fields": {
"customfield_15035": [{"prop1":"xxxxx","prop2":"yyyyy","prop3":"zzzzz"}]
}
}
json_payload = json.dumps(payload)
headers = {
"Content-Type": "application/json"
}
response = requests.put(url.format(issue_key=issue_key), data=json_payload, headers=headers, auth=auth)
print(response.status_code)
What kind of customfield are you trying to update ?
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.