Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 248
Artsom Avatar asked Aug 12 '26 17:08

Artsom


1 Answers

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

like image 143
Stanislav Lipovenko Avatar answered Aug 14 '26 10:08

Stanislav Lipovenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!