Is there a way to query which filters are calling out a specific project?
Hi @stephan_lewis
What do you mean by "connected to a project"?
If you mean shared with the project, you could use this REST API function and filter by projectId:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-rest-api-3-filter-search-get
If you mean the JQL for the filter references the project, I believe would need to remove the filter, add expand=jql, repeatedly run the function to page through the results, and search for the project name in the JQL.
Kind regards,Bill
not sure what you mean by "remove the filter, and expand=jql"
The REST API seems like it will do what I want - but I've never done this, How do I get started?
In the API @Bill Sheboy mentioned you can provide as an input parameter the ID or name of a specific filter and retrieve that one filter.
Alternately you can opt to not provide those inputs and instead add the parameter expand=jql to get all filters and include the JQL of each filter in the output. You may have to run the API command multiple times depending on the total number of filters in your system.
You would need to collect the output of all those executions and they yourself execute a search against that output to look for the project of interest within the JQL statements contained in the output.
One easy way to run the REST APIs is:
1. login to your Jira instance.
2. Open a new browser tab.
3. Take the base URL for your Jira instance (i.e. https://yourCo.atlassian.net), append the REST API endpoint (i.e. /rest/api/3/filter/search) and then append the parameters you want to use, and put that all in the URL field of the new browser tab.
Sounds good - but I'm having problems with appending the parameters
https://yourCo.atlassian.net/rest/api/3/filter/search
I want to search for the project MARO
If you want to follow Bill's suggestion you need to use this URL in a browser tab:
https://<your jira URL>/rest/api/3/filter/search?expand=jql
Note that you need to replace <your jira URL> with the actual base URL for your Jira instance.
You will get output similar to the following - a list of the filters on your instance including the JQL for each filter. Notice the JQL underlined in red:
You will have to search that output for the text of your project key or project name contained in the JQL statements.
Note that if you have a lot of filters the API will paginate the data. That means the first execution will return only the first "page" of results. Notice the sixth line in the output that says "total": 67 and the third line that says "maxResults": 50. That tells you that there are a total of 67 filters on the system and only the first 50 have been returned.
It looks like you're new here. Sign in or register to get started.