Artsom
Artsom

Reputation: 171

Create issue via python rest api jira

So, I have written python code which interact with Jira api via python library atlassian_python_api

from atlassian import Jira

jira = Jira(
     url="https://jira.example.com/",
     username='gonchik.tsymzhitov',
     password='admin')

jira.issue_create(fields={
    'project': {'key': 'TEST'},
    'issuetype': {
        "name": "Task"
    },
     'summary': 'test rest',
     'description': 'rest rest',
})

After the issue has been created with key TEST-2045 (the number 2045 was generated automaticly).

The question is: How can I insert my own issue number? For example, TEST-15 ?

Upvotes: 7

Views: 12029

Answers (2)

Alex Alik
Alex Alik

Reputation: 1

For those of you who might run into the error JIRA' object has no attribute 'issue_create':

it should be "jira.create_issue".

Upvotes: 0

Stanislav Lipovenko
Stanislav Lipovenko

Reputation: 574

that's the 'key' field. and you can't provide it while creating jira issue, it's predefined behavior see the topic at atlassian forum: https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-specify-key-when-creating-issue-via-API/qaq-p/574472

Upvotes: 3

Related Questions