Update custom field using python script

Prashant May 17, 2022

I am trying to update customfield_12001 field and getting 400 response. What am I doing wrong?

import requests
from requests.auth import HTTPBasicAuth
import json

JiraApiUrl = "https://jira.vanguard.com/rest/api/2/issue/CSDSOSRE-2936"

auth = HTTPBasicAuth("UserId", "Password")


headers = {"Accept": "application/json", "Content-Type": "application/json"}

payload = json.dumps({"update": {"customfield_12001": [{"value": "XYZ"}]}})

response = requests.request("PUT", JiraApiUrl, data=payload, headers=headers, auth=auth)

print("Response: " + str(response))

Response is 400

 

0 answers

Suggest an answer

Log in or Sign up to answer