Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create an issue in jira via rest api?

Tags:

rest

jira

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 example would be nice.

like image 775
ymajoros Avatar asked May 04 '11 14:05

ymajoros


People also ask

What is the use of REST API in Jira?

The Jira REST API enables you to interact with Jira programmatically. Use this API to build apps, script interactions with Jira, or develop any other type of integration. This page documents the REST resources available in Jira Cloud, including the HTTP response codes and example requests and responses.

Does Jira support REST API?

The Jira Server platform provides the REST API for common features, like issues and workflows. To get started, read the reference documentation: Jira Server platform REST API .


1 Answers

POST to this URL

https://<JIRA_HOST>/rest/api/2/issue/ 

This data:

{ "fields": {    "project":    {        "key": "<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://<JIRA_HOST>/rest/api/2/issue/83336"} 

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

like image 157
msangel Avatar answered Oct 10 '22 00:10

msangel