Jira REST API to get projects?

Rajesh Kappa February 14, 2018

Hi all,

I need help whats the API call in jira to get projects in jira

Thanks,

Rajesh.

3 answers

1 accepted

9 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2019

Hi,

Since the original answer was posted to this question Atlassian Cloud has deprecated that specific endpoint (GET /rest/api/2/project).   As such there is another endpoint you can use now to get back your projects via REST in Jira Cloud.

For Jira Cloud:

Since you can no longer use the old endpoint, you can instead use the GET /rest/api/3/project/search to return these projects via a search

 

For Jira Server:

You can make a REST API call to the endpoint GET /rest/api/2/project.  In Jira Server this endpoint will return to you all the projects which are visible to the user making that REST call.

I hope this helps to clarify how you can do this in both platforms.

Andy

David Williams
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2019

From what I can find online, the cloud /rest/api/3/project/search does not have an option for returning ALL projects. Do you know if this possible?

David Williams
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2019

Figured it out;

/rest/api/3/project/search?jql=&maxResults=200

Like # people like this
Arun Gupta September 12, 2022

I tried this but it still returns max 50 results

Like Alex Rumer likes this
Emilio Marinone
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 23, 2023

Is Jira Server still using (GET /rest/api/2/project)?

Sudhier Nannan November 14, 2023

it does

2 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 14, 2018

Hi Rajesh,

You would use the following endpoint:

/rest/api/2/project

Take a look at the REST API documentation for Get All Projects:

 

Get all projects

GET /rest/api/2/project

Returns all projects visible for the currently logged in user, ie. all the projects the user has either ‘Browse projects’ or ‘Administer projects’ permission. If no user is logged in, it returns all projects that are visible for anonymous users.

App scope required: READ

Response content type: application/json

Request

Query parameters

expand

string

Multi-value parameter defining request properties to expand in the response. These are not returned by default. Allowed values:

  • description - description of the project.
  • projectKeys - all project keys associated with the project.
  • lead - project lead. Note, that project lead role is different from project administrator one.
  • issueTypes - issue types associated with the project.
  • url - a URL associated with the project.

recent

integer

Only projects recently accessed by the current user will be returned if this parameter is set. If no user is logged in, recently accessed projects will be returned based on current HTTP session. Maximum count is limited to the specified number, but no more than 20.

Take a look at that and let me know if it helps.

Cheers,

Branden

0 votes
Fayaz Abdul July 20, 2020

Is it possible to get some projects as the project name starts with "ABC" or "ABC*"?

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 21, 2020

The answer if different between Cloud and Server.  

For Server, there is no REST API endpoint you can query to search by projects like this.

But in Cloud you could use the endpoint of GET /rest/api/3/project/search : Get projects paginated to at least search for projects by name.  Granted this does not let you specify begins with, but instead will search the entire title for any string that you might include in the query parameter of that endpoint.  For example doing a search there of ABC would include any project names that contain that string, not just those that start with that string.

Like Domingos Vargas likes this
Chris Caspanello
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 7, 2021

@Andy Heinzer - Is there any plans to add the search feature to the Server version?  Some of our customers have many projects and are experiencing slow load times with our product because we are fetching all projects.  A search API would be very beneficial.

Also, is there may be another strategy we could leverage?  Our goal is just to return a list of Project Names and IDs . . . we don't need all the details.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2021

Hi @Chris Caspanello 

I have not found an easy way to manage this in Jira Server/Data Center.  The existing server REST API endpoints don't permit you to query or filter down the returned projects in the manner of search at this time. So I created a feature request for this over in https://jira.atlassian.com/browse/JRASERVER-72607

I can certainly understand why this would be useful to have, and seeing that Jira Cloud already does this, it makes sense that this is something that could improve performance in some cases and ease integrations.  Currently, the only way to return a single specific project would be to know either the project key or project id and then call the endpoint GET /rest/api/2/project/{projectIdOrKey} where you can pass that info in the call itself.

Venkadelakshmi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2024

How can we represent data via visualization like graph ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events