Forums

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

Field 'cf[24954]' cannot be set. It is not on the appropriate screen, or unknown.

Yunao Liu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2020

Hi, 

I'm trying to update a custom field (Labeling Status) in the issue using the Python Jira library (https://pypi.org/project/jira/). When I'm trying to update a custom field, I got errors

jira.issue("XXXXXXXXX").update({'cf[24954]': 'to_be_labeled'})
`Field 'cf[24954]' cannot be set. It is not on the appropriate screen, or unknown.`

 

I googled for a long time, and most answers are about the particular custom fields that are not in the create/edit screen. However in my case, I do see those custom fields editable on the web page, but just not on the default screen. I've also ruled out some other possible problems:

  • No auth problem, I can use Python client to edit standard fields (e.g. description) of the same issue/ticket
  • The custom field number is correct
  • I can see the custom field (Labeling status) in create/edit screen, however under a non-default tab. 
  • Screen Shot 2020-10-27 at 11.43.50 PM.png
  • Screen Shot 2020-10-27 at 11.50.17 PM.png

 

Anyone know what might be the problem? 

 

1 answer

1 vote
Dirk Ronsmans
Community Champion
October 28, 2020

Hi @Yunao Liu ,

well the error pretty much says it.

`Field 'cf[24954]' cannot be set. It is not on the appropriate screen, or unknown.`

if the field exists (which I assume it does) it's just not on the edit screen of the issue type that you are trying to edit.

Can you verify that the Edit Screen of the issue type that you are editing contains your custom field?

The non-default tab shouldn't matter.. it's still part of the screen but to make sure it's not a bug you can always move it to the default one for a test.

 

Dirk Ronsmans
Community Champion
October 28, 2020

Hey @Yunao Liu

i've just gone through the documentation quicky and this just seems to call the REST api for updates.

Can you try setting the field using customfield_24954 ?

so the command would be:

jira.issue("XXXXXXXXX").update({'customfield_24954': 'to_be_labeled'})
Dirk Ronsmans
Community Champion
October 28, 2020

@Yunao Liu

So I've done a little more testing on my local instance and I was able to set a custom field using the following syntax:

 

from jira import JIRA

jira_server='xxxxx'
username='xxxxx'
password='xxxxx'
aj = JIRA(basic_auth=(username, password), options={'server': jira_server})


issue = aj.issue('xxxxx')

print(issue.fields.customfield_10902)
issue.update({'customfield_10902': 'xxxx'})

 

This gives me a clean update of the customfield so as I expected you'll have to use the customfield_<yourid>

Suggest an answer

Log in or Sign up to answer