Not able to access data from Rest API

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 vote
Alexey Matveev Community Champion Dec 13, 2017

Hello,

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

That is what the response, it is eempty

Alexey Matveev Community Champion Dec 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

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

Thanks @Christian Reichert,

 

Its accessible by using /issue/{issueIdOrKey}.

 

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

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  

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

94 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you