3
votes

I want to create a jira issue in python. I know how to set the summary, issue type, description and project name but I can't find how to set priority, due date, environment and other fields.

This is what I know:

new_issue = jira.create_issue(project={'key': 'key'}, summary='New issue from jira-   python',   description='Look into this one', issuetype={'name': 'Bug'})

How can I set the other fields?

1

1 Answers

11
votes

The question is really about the Jira REST API itself, not the python client, since it is a very thin layer.

According to the Issue Fields in JIRA REST APIs, priority can be set this way:

new_issue = jira.create_issue(project={'key': 'key'}, 
                              summary='New issue from jira-python',   
                              description='Look into this one', 
                              issuetype={'name': 'Bug'}, 
                              priority={'name': 'Major'})

As for the other fields, use the REST API Browser (RAB) to inspect what other fields are available for filtering issues in a particular project (as you may know fields can vary from project to project).