Forums

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

How to get list of all custom fields that are not associated to any project or last used 2 yrs ago

Maria Mariella Bautista
Contributor
January 25, 2024

Hi,

Currently we have more than 700 custom fields and wanted to have a clean up where custom fields that is not associated to any project or last used was 2 years ago can be deleted. We could do it manually from UI view but I'm currently exploring in creating a PowerShell script with using APIs to get the list.

I'm aware of "https://<site-name>/rest/api/2/field" would get me the list of fields but unsure how to play it out from there.

Would appreciate if you could help me in creating or give some tips for next steps.

Thank you!

1 answer

1 accepted

2 votes
Answer accepted
Maria Mariella Bautista
Contributor
January 25, 2024

Found below API call below which is very suited to my requirement:

https://<site>/rest/api/3/field/search?maxResults=100&type=custom&expand=screensCount,lastUsed

(It doesn’t return a list of screens that use the custom field, but rather, just the number of screens, and the last time the custom field was used.)

Suggest an answer

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

Atlassian Community Events