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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

803 views 2 19
Join discussion

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