Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the list of project in jira?

Anandhakrishnan May 4, 2021

Hello all,

we are really trouble to integrate one sample application to jira. and finally we configured using consumer key and public key. now I am trying to get the project list in jira using java . but i got the empty string only.

https://domain_name.atlassian.net/rest/api/3/project

I have tried this url and also pass the username and api token for basic authentication .but it return empty list.I have mentioned the code below.

 

HttpResponse<JsonNode> response = Unirest.get("https://<Domain_name>.atlassian.net/rest/api/3/project")
.basicAuth("username", "<api_token>")
.header("Accept", "application/json")
.asJson();

System.out.println(response.getBody());

 

2 answers

0 votes
amit anand May 4, 2021

Install Rest API browser and use API to list your project

Anandhakrishnan May 4, 2021

we are also tested the postman API tool and some online test API also . but it getting same empty list.

0 votes
Sagar Mahajan
Community Champion
May 4, 2021

Hi @Anandhakrishnan  You can use the below endpoint as above one is deprecated by Atlassian as mentioned in the below document :

https://domain-name.atlassian.net/rest/api/3/project/search

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/

Anandhakrishnan May 4, 2021

 I have tested the first link and got the below values. like empty [].




{"self":"https://<doman_Name>.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0","maxResults":50,"startAt":0,"total":0,"isLast":true,"values":[]}

Suggest an answer

Log in or Sign up to answer