Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Error Update Custom Field using API Python

Genival Neves Brasil Junior November 16, 2022 edited

Dear Friends,

I need to update some custom fields in JIRA using the value of another custom field in the same issue.

I developed a routine in Python, structured to update the field with the requested values.

In the tests carried out I am getting the error message below.

"fields.customfield_12302": "Field 'fields.customfield_12302' cannot be set. It is not on the appropriate screen, or unknown."

Does anyone know how to resolve? Below is the code I'm using in the tests.

 

for i in dfIssues.index:

url = "https://clarodigital.atlassian.net/rest/api/3/issue/" + dfIssues['id'][i]

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

payload = json.dumps( {
"fields": {
"fields.customfield_12302": dfIssues['fields.customfield_12301'][i]
}
})

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

1 answer

0 votes
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2022

@Genival Neves Brasil Junior ,

So far, no payload errors have been pointed out. The error indicates that the ID field 12302 is not being displayed in the issue.

Have you tried putting this field to be displayed in the issue? Make sure it's on the "Edit" and "View" screens.

Then try again and see if the error still persists.

Genival Neves Brasil Junior November 18, 2022

Hello Fernando,

The fields are already configured in the screen schema and appear normally in the Issue.

I performed two tests on both fields successfully:

- Directing in Jira changing the value of the field that I'm having problems with;

- In Python printing the value of the fields that 12302 and 12301;

Any other suggestions?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events