how to create an issue in jira via rest api?

后端 未结 9 2381
北恋
北恋 2020-12-08 19:24

Is it possible to create an issue in jira using REST api? I didn\'t find this in the documentation (no POST for issues), but I suspect it\'s possible.

A wget or curl

9条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 19:34

    POST to this URL

    https:///rest/api/2/issue/
    

    This data:

    {
    "fields": {
       "project":
       { 
          "key": ""
       },
       "summary": "REST EXAMPLE",
       "description": "Creating an issue via REST API",
       "issuetype": {
          "name": "Bug"
       }
      }
    }
    

    In received answer will be ID and key of your ISSUE:

    {"id":"83336","key":"PROJECT_KEY-4","self":"https:///rest/api/2/issue/83336"}
    

    Don't forget about authorization. I used HTTP-Basic one.

提交回复
热议问题