The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Fernando Eugênio da Silva
Community Champion
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?

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events