Forums

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

is there a way to find list of projects using customfield using scriptrunner / api?

Deepak
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!
May 7, 2025

is there a way to find list of projects using customfield using scriptrunner / api?

2 answers

1 vote
Kristian Walker _Adaptavist_
Community Champion
May 8, 2025

Hi Deepak,

I have created a sample script which shows how you can find this information in Jira Data Center with ScriptRunner using the HAPI APIs.

The script can be seen here and uses the approach Leo mentions above to find the project keys. 

Note that the script returns 1000 issues at a time, and if you need more, you can adjust this in the numberOfIssuesToReturn variable. However, we would advise you to consider how returning a large number of issues will cause the script to take a long time to run.

I hope this information helps.

Regards,

Kristian

0 votes
Leo Prakash_CodeForMe_
Contributor
May 7, 2025

Hi @Deepak

I have done something similar in back days through scriptrunner. though I don't have script in handy, below is the logic I applied to get No. of projects using so and so field

 

1. Run a jql in scriptrunner with query " fieldname_name is not empty"

2. Split keys by - and store them in array 

3. apply unique function to get unique project keys

 

Regards,

Leo

Suggest an answer

Log in or Sign up to answer