Not able to access data from Rest API

srinivas annem December 13, 2017

Hi All,

I have created a atlassin account for testing the Jira rest api and created a project and  tickets under it.

I am able to access the projects but not the issues under it. Please find below for more info

Capture.PNGCapture1.PNGCapture2.PNG

Could someone please help me with this.

Thanks,

Srinivas

2 answers

0 votes
Christian Reichert (resolution)
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.
December 13, 2017

Hi @srinivas annem,

that endpoint doesn't exist for a GET.

It only exists for a PUT to create Issues (Create issue).

Could you try a get to an endpoint below that ... for example:

GET /rest/api/2/issue/{issueIdOrKey}

With the IssueKey of one of your existing Issues?

api/2/issue


Cheers,
Christian

srinivas annem December 13, 2017

Thanks @Christian Reichert (resolution),

 

Its accessible by using /issue/{issueIdOrKey}.

 

Is there any way to list all issues under a project. 

Christian Reichert (resolution)
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.
December 13, 2017

Hi @srinivas annem,

the GET /rest/api/2/search that @Alexey Matveev posted is probably what you are looking for.

api/2/search

Your JQL would then look like "project = <MYProject>" i.e. "project = Support-Test"

It's the same JQL that you use on the Search Issues interface within Jira.


Cheers,
Christian  

0 votes
Alexey Matveev
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.
December 13, 2017

Hello,

When you query issues from Jira what is the response status? I can not find it on your screenshots

srinivas annem December 13, 2017

That is what the response, it is eempty

Alexey Matveev
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.
December 13, 2017

Each response has a status. It is a number. If the response is successful then  it returns 2xx. In your case the response would be 405 "Method is not allowed". You could make a guess out of it that GET is not allowed. After it you should open the REST API Reference

https://docs.atlassian.com/software/jira/docs/api/REST/1000.1584.0/#api/2/issue-createIssue

You could see there that for the Rest Call you are trying to do there is only the POST method which will let you to create an issue. 

You are trying to select issues, that is why you should use

GET /rest/api/2/search

Suggest an answer

Log in or Sign up to answer