When I first clicked on the status filter button, it delayed a good 4-5 seconds before painting. Looking into it, it seems it's the REST API endpoint for all statuses on a given Jira instance:
|
const request = await axios.get(`${apiUrl}status`); |
My instance has hundreds of customized statuses, where some teams do agile, some issue tracking, some basic Kanban, etc, and each project uses a set of customized statues based on predefined patterns. So my given project does not uses most of the returned list of statuses.
Since this widget displays data specific for a project, I think the status collection should be only those valid for the project. The project status call on large instances is also faster.
I tried a PR to fix this, but I'll admit to getting a bit lost into the mechanics of React's useState calls firing the hooks.
But the simple API change is as so:
const request = await axios.get(`${apiUrl}project/${projectKey}/statuses`);
It returns in the same format as the root instance /status
API call. Essentially, need to call the statuses call per project like so:
https://docs.atlassian.com/software/jira/docs/api/REST/8.14.0/#api/2/project-getAllStatuses
And this necessitates passing the projectKey into the status hook.