Forums

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

Jira Python: 'customfield_15400' cannot be set. It is not on the appropriate screen, or unknown.

VTS December 13, 2018

Hello, 

I am trying to create an issue in my project with some custom fields, via the python jira API. I need to use some custom fields to store some info. 

If I create an issue via the following, everything works great

def createIssue(self):
issue_dict = {
'project': {'key': 'GLOB'},
'summary': 'New issue from jira-python',
'description': 'Look into this one',
'issuetype': {'name': 'Bug'},
}
self.__client.create_issue(fields=issue_dict)

 

But, when I introduce a custom field, everything breaks

def createIssue(self):
issue_dict = {
'project': {'key': 'GLOB'},
'summary': 'New issue from jira-python',
'description': 'Look into this one',
'issuetype': {'name': 'Bug'},
'customfield_15400': {'value' : 'NO'}

}
self.__client.create_issue(fields=issue_dict)

And I get the following error:

Field 'customfield_15400' cannot be set. It is not on the appropriate screen, or unknown.

Does anyone know how to overcome this? Thanks! 

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2018

You need to do what it suggests - ensure that custom field is on the "create" screen for the issue type for that project.

Try logging in as normal and creating a Bug in project Glob - do you see the custom field?  I suspect you will not, because it needs to be added.

VTS December 13, 2018

I actually created a test field for Bugs in my workspace called "Test", which is a custom Text Field.

If I create a Bug through the UI, it successfully fills my custom field and is a bug ticket is able to be created. This issue only happens when using the Python API. 

 

If I try the following,

def createIssue(self):
issue_dict = {
'project': {'key': 'GLOB'},
'summary': 'New issue from jira-python',
'description': 'Look into this one',
'issuetype': {'name': 'Bug'},
'test': {'value' : 'NO'}

}
self.__client.create_issue(fields=issue_dict)

It does not work, and throws the aforementioned error. 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2018

What field is customfield_15400?

VTS December 13, 2018

Turns out it was a permissions issue. Thanks for the help! :) 

Deleted user March 31, 2019

Could you explain about the permissions issue, please? Is there an explicit permission to modify custom fields?

I am using the same user for UI and API. I successfully create an issue with specifying the custom field via UI , but getting an error when using API.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2019

No there's no field permissions, VTS must mean that the account running the REST call did not have "edit issue" rights.

What error are you getting and what type of field is it?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events