Hello,
I have been looking to create an API post to Jira via Python which would create a ticket.
I have been successful in creating the ticket with a Project, Summary, Description and Issue Type. However, when I go to add a new Custom Field I am struggling. I have included the code below which was successful for the initial ticket creation;
new_issue = jira.create_issue(project='ProjectName', summary='New issue', description='Look into this one', issuetype={'name': 'Initiative'})
Then below is the attempt to add in the custom fields which failed.
new_issue = jira.create_issue(project='ProjectName', summary='New issue', description='Look into this one', issuetype={'name': 'Initiative'}, fields={'14778': 'Information'})
Any help is greatly appreciated!
Hi and welcome to the Community!
How you set customfields with the REST API depends greatly on the type of field. Furthermore you also did not specify whether you are using server, datacenter ord cloud, which can lso be a different approach. That being said I can see something weird in your call:
fields={'14778': 'Information'}
Pretty sure this should be:
fields={'customfield_14778': 'Information'}
as per the documentation:
Cloud: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post
Server:
https://docs.atlassian.com/software/jira/docs/api/REST/9.11.0/#api/2/issue-createIssue
Regards,
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.