Forums

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

How to filter projects by last updated date

Susheela_Kushwaha
Contributor
May 30, 2023

Hi,

I am working on a script to auto archive the Jira projects in Jira Cloud. Part of the script require identifying projects that are not updated in last 3 months. Is there a way to extract this information via JQL?

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2023

Hello @Susheela_Kushwaha 

JQL is for getting lists of issues, not lists of projects. There is no searchable fields at the project level for the last time overall that an issue in that project was updated.

You can, however, extract a list of all projects using the REST API. The data returned for each project includes the last date an issue in the project was updated.

Susheela_Kushwaha
Contributor
May 30, 2023

Thank you Trudy! Let me explore the REST API option. Appreciate your quick response.

Susheela_Kushwaha
Contributor
May 30, 2023

Hey Trudy, I tried the REST API to filter projects by last updated time but it does not seem to work. Could you please help me fix it?


/rest/api/3/project/search?orderBy=lastIssueUpdatedTime

Both of the queries below are giving the same output:

/rest/api/3/project/search?orderBy=+lastIssueUpdatedTime

/rest/api/3/project/search?orderBy=-lastIssueUpdatedTime

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2023

Are you actually getting the lastIssueUpdatedTime attribute in your results? I am not.

I also now notice that the API says the expansion of the insight attribute where lastIssueUpdatedTime is contained is experimental, so perhaps it doesn't actually work yet. I have not actually tried it before. I don't actually spend much time working directly with the API.

Screen Shot 2023-05-30 at 3.18.37 PM.png

Susheela_Kushwaha
Contributor
May 31, 2023

That is correct, the attribute is not listed in the JSON output for me too.

Susheela_Kushwaha
Contributor
June 1, 2023

So, I was able to figure out how to extract the last updated time per project using following REST API call: /rest/api/3/project/search?expand=insight

Like • Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events