We are developing a forge app and would like to have a multi select dropdown to list all the projects in Jira instance?
We checked the APIs and this API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-search-get, provides only 50 projects at one go, and since we are developing with forge, we need to consider the 25 sec. limit. If my instance has 5000 projects, I would require 100 API calls for it which could not get complete in 25 seconds. We store the ids of selected projects in the storage API.
The workaround to solve this, which we have used is, to fetch first 50 projects and show in list along with selected ones. The issue with this is if we have lot of selected projects as well, we need to do multiple API calls.
Like if we have already selected 170 projects.
When we open the configuration page of the app, first we do API call to storage API and find all the previously selected projects. Now we would need to do 4 calls to https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-search-get with comma separated project ids. Once done, we add this in dropdown and then do a call to get first 50 projects and show it as well. The first 4 calls is to ensure if any project is deleted or archived it is not shown now.
This limitation of 50 makes it complex and increases the API calls as well.
Is there any solution to this?