Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×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!
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What field is customfield_15400?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.