Creating new jira issue using RESTv4.3

Samuel Wayne January 16, 2012

I'm trying to create a new jira issue using REST API v4.3. I can't find a solution for this in the documentation. Should i go to SOAP or REST has an option to do this?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
gauravkohli January 16, 2012

REST API don't support create issue option currently. REST API in Jira 5.0 would support that http://docs.atlassian.com/jira/REST/5.0-m4/#id435193 so currently you can only use SOAP to create a issue.

Samuel Wayne January 16, 2012

Thanks Gaurav. I'm just starting with integrating JIRA in my system. For versions prior to v5, what do you suggest for remote systems.. SOAP or REST? I could see that the REST api is just evolving from version 5... Also the rest api documentation for version 4.3 and 4.4 does not have an exhaustive feature list.

gauravkohli January 16, 2012

Hi Samuel,

I would have suggested using REST api's, as I think REST should eventually replace SOAP API's, but if Issue creation is very important part of your integration then you don't have any option other than SOAP API's. Other thing which you can try is start integrating with REST API's of 5.0 as that would be released in next month or so.

Samuel Wayne January 17, 2012

Thanks for the council Gaurav. Currently my requirement is to integrate with version 4.4 and earlier. But the documentations i found in https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+(Alpha)+Tutorial for version 4.4 is not so exhaustive. For example, there are no methods to get information about the projects and users which I believe are available in SOAP.

Also, as you suggested, If i start developing my application to integrate with REST API version 5.0, that should work well for earlier verions as well right?

0 votes
hsuhailah
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2012

Hi Samuel :)

You were right about REST documentation is incomplete. Prior to 5.0, SOAP is recommended instead.

- Creating a SOAP Client

- How do i get more help with SOAP?

Samuel Wayne January 17, 2012

Thanks Hanis. I was just playing around with the REST API v5. I created an evaluation account for jira-ondemand couple of days back and tried the following curl, when i got the creepy error. Can you please let me know what can be done for this..

The requested resource (/rest/api/2/issue/createmeta) is not available.

The curl command is curl -D- -u xxxx:xxx -X GET -H "Content-Type: application/json" https://company-name.atlassian.net/rest/api/2/issue/createmeta

Azwandi Mohd Aris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2012

Hi Samuel,

Currently, JIRA OnDemand is of version 4.4.1 - see this page. The method createmeta is only available in JIRA 5.0 REST API.

Azwan

Samuel Wayne January 17, 2012

Thanks for the clarification Azwan.

Azwandi Mohd Aris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2012

No worries! If you wish to try out JIRA 5.0, you can try our Early Access Program - http://www.atlassian.com/software/jira/download-eap :)

Samuel Wayne January 17, 2012

Sure Azwan :-) I have a small query on the rest url. How do i pass the session id in the below url to call the api methods. Right now, i'm just passing the credentials for playing around with api.

curl -u username:pwd https://company.atlassian.net/rest/api/2.0.alpha1/project/DEMO

Azwandi Mohd Aris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2012
Samuel Wayne January 17, 2012

Yep. I got that point earlier. I just wanted to know how to use that cookie for subsequent requests. Is there a curl example for that.. After login the login cookie i get is JESSIONID. I just wanted to know how to use this. Thanks.

Samuel Wayne January 17, 2012

Thanks for the clarification Azwan. That's all I wanted. :)

Azwandi Mohd Aris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2012

Oh, in that case, you can use "-b" parameter. E.g.:

curl -c cookie_jar -u username:password https://mydomain.atlassian.net/rest/auth/1/session

curl -b cookie_jar https://mydomain.atlassian.net/rest/api/2.0.alpha1/project

Azwandi Mohd Aris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2012

No worries!

TAGS
AUG Leaders

Atlassian Community Events