how to create an issue in jira via rest api?

后端 未结 9 2351
北恋
北恋 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:36

    To answer the question more direct, i.e. using cURL.

    To use cURL to access JIRA REST API in creating a case, use

    curl -D- -u : -X POST --data-binary "@"  -H "Content-Type: application/json" http:///rest/api/2/issue/
    

    And save this in your < Filename> (please edit the field per your Jira case) and save in the folder you call the cURL command above.

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

    This should works. (note sometimes if it errors, possibly your content in the Filename is incorrect).

提交回复
热议问题