Hi Team,
I want to fetch the list of all the projects for a particular domain(say https://xyz.com) i.e. all project names, their keys, status(if that project is marked as active/inactive/archive by that particular domain). Basically, through status, I want to track all projects.
Please suggest the API Url to get all the details asap.
@Warren do you have any idea for the same also? Anyone else having knowledge about this please respond.
Thanks
Rashi
Project archiving is available for Jira Software Data Center and Jira Service Desk Data Center. For Jira Server and Jira Cloud, the endpoint:
/rest/api/{version}/project/{projectIdOrKey}
returns a value 'active' which will be either true or false. There doesn't seem to be any value returned that indicates if it's been archived.
However, the REST API v3 endpoint:
/rest/api/3/project/search
has an experimental feature that allows you to set the filter parameter of 'status' as being an array of three possible values, 'live', 'archived' or 'deleted' to filter the results. So the query:
/rest/api/3/project/search?status=archived
would return a list of projects that had the status of being archived.
Refer to this article for more information on how to use that endpoint.
@Sunny Ape when I am using URL /rest/api/3/project/search?status=archived
I am getting a blank array as
stdClass Object ( [self] => https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0&status=archived [maxResults] => 50 [startAt] => 0 [total] => 0 [isLast] => 1 [values] => Array ( ) )
Can you please guide why this array is blank.
And also when I am using URL /rest/api/{version}/project/{projectIdOrKey}
then, which field/array will indicate that the project is archived or not.
Thanks for the help BTW
Rashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rashi Goyal ,
As you are in cloud, it seems that there is a feature request to cover your request:
https://jira.atlassian.com/browse/JRACLOUD-30664
(As a side note, for Server there is this ticket:
https://jira.atlassian.com/browse/JRASERVER-30664 )
That said, in Cloud you can go to Jira Settings-> Projects and check the last time that an issue was updated for every project. This could give you an idea of what projects may be inactive (if the haven't been updated in a number of months, e.g.):
Regarding archived projects, this article contains details about how to manage archived projects in the Cloud: https://confluence.atlassian.com/adminjiracloud/archive-a-project-1013843066.html
From the article above, "Issues in archived projects won't appear in basic or advanced search results. You can access these issues through direct links, but you can't edit them"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Carlos Garcia Navarro I want to do this programmatically using an API call.
Thanks still. If you have any idea related to the API please suggest
Thanks,
Rashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rashi Goyal ,
This document is a guide to the APIs to get project information:
I ran the call /rest/api/3/project/search, but didn't get the information about 'last issue update' or information about active/inactive/archived.
I'll keep trying but I'm not sure you can get this from an API directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Carlos Garcia Navarro I am also checking the same but this is giving me the list of all projects near about 800 but in actual active/live is 130.
@Warren any suggestion from your side. I want to develop something on urgent, please guide.
Rashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rashi Goyal
Your return array being blank when you search for archive projects suggests that there aren't any. We don't archive projects and I get the same result, but if I use status=live then all our projects are returned.
So, what do you get for
https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0&status=live
That should only return the ~130 projects that you have.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Warren I tried the same way but I am getting a total as 845 i.e. all projects archived/active/inactive
[maxResults] => 50 [startAt] => 0 [total] => 845
Does that mean there is no way to get the active projects right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rashi Goyal
If I run that API call on our system using the 3 options, this is what I get
ARCHIVED
DELETED
LIVE
This exactly matches what is on our system, and you should be getting the same on yours. Are you certain that the API call is going through correctly?
Could you copy the API call into a browser and run it from there, like I have done? That eliminates any changes that your code may be doing. So literally copy
https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0&status=live
into a browser where you're already logged in to Jira, and give us a screenshot similar to what I showed above
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Warren please check the response. I did it in the same way.
{"self":"https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0&status=live","nextPage":"https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=50&status=live","maxResults":50,"startAt":0,"total":845,"isLast":false,"values":[{"expand":"description,lead,issueTypes,url,projectKeys,permissions,insight","self":"https://netsmartz.atlassian.net/rest/api/3/project/13700","id":"13700","key":"AA","name":"ABC Automation","avatarUrls":{"48x48":"https://netsmartz.atlassian.net/secure/projectavatar?pid=13700&avatarId=10011","24x24":"https://netsmartz.atlassian.net/secure/projectavatar?size=small&s=small&pid=13700&avatarId=10011","16x16":"https://netsmartz.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=13700&avatarId=10011","32x32":"https://netsmartz.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=13700&avatarId=10011"},"projectTypeKey":"software","simplified":false,"style":"classic","isPrivate":false,"properties":{}},
Still total is 845. It must be 137
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rashi Goyal
So if only 137 projects are live, what state are the rest? Are they all archived? What happens if you run the API call with status=archived? Let's see those results
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Warren using the url: https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0&status=archived
Result is ::
{"self":"https://netsmartz.atlassian.net/rest/api/3/project/search?maxResults=50&startAt=0&status=archived","maxResults":50,"startAt":0,"total":0,"isLast":true,"values":[]}
projects are archived I checked.
I don't understand what is the actual problem.
Rashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The URL in that example shown starts with 'netsmartz.atlassian.net'. That is a Jira Cloud instance.
This article says that archiving projects is only available for Jira Software Data Center and Jira Service Desk Data Center.
But this article says project archiving is available for Jira Software Cloud but only the Premium plans.
I've sent a content notice to Atlassian that the two pages seem to contradict each other.
If you are certain that Netsmartz is using a version / plan of Jira that supports project archiving, and you are certain there are projects that have been archived, as per the documentation, but the REST API is returning an empty array (no archived projects) when queried correctly, and you're authenticating with an account that has the appropriate permissions to browse archived projects, then something is wrong and I think you should contact Atlassian support for assistance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, @Sunny Ape
Let me confirm.
Did you get the answer to your query from Jira support? Please confirm.
@Warren any guidance from your side?
Rashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.