Jira issues - Fix missing filter query params not sent to backend
What does this MR do and why?
- Change "projects[]" param to "project" (previous MR !145377 (merged)):
- Change in implementation since we will only allow filtering by a single project at a time. The
projects[]
syntax with multiple values also wasn't consistent with labels aslabels[]
implied an AND query while projects (if supported) would always be an OR query. - This change is behind a feature flag
jira_multiple_project_keys
.
- Change in implementation since we will only allow filtering by a single project at a time. The
- Fix missing filter query params:
- When migrating to GraphQL, we unintentionally broke some of the filtering logic by not including all filter params as described in the documentation: https://gitlab.com/gitlab-org/gitlab/-/blob/32ef0abe696e22a4f3ca420822503eff759079b5/doc/integration/jira/configure.md#L126
- This change adds back the "status", "author_username" and "assignee_username" filters and sends them to the backend.
Changelog: fixed
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Frontend URL query param | Backend request |
---|---|
project=KEY | project: KEY |
status=To+Do | status: To Do |
assignee_username=Justin+Ho+Tuan+Duong | assignee_username: Justin Ho Tuan Duong |
author_username=Justin+Ho+Tuan+Duong | author_username: Justin Ho Tuan Duong |
For example, http://127.0.0.1:3000/gitlab-org/gitlab-test/-/integrations/jira/issues?project=FE&status=To+Do&author_username=Justin+Ho+Tuan+Duong&assignee_username=Justin+Ho+Tuan+Duong
.
How to set up and validate locally
If not you don't have a Jira account / instance:
- Sign up for a free Jira instance for developers.
- Create a Jira project and add a couple of dummy issues.
In GitLab:
- Setup the Jira integration in Project > Settings > Integrations > Jira (
http://127.0.0.1:3000/gitlab-org/gitlab-test/-/settings/integrations/jira/edit
). Make sure you check the Enable Jira issues option in Issues section and use the project key of the Jira project you created above. - Go to Project > Plan > Jira issues (
http://127.0.0.1:3000/gitlab-org/gitlab-test/-/integrations/jira/issues
). - Add the filter
project=KEY
in the URL (http://127.0.0.1:3000/gitlab-org/gitlab-test/-/integrations/jira/issues?project=KEY
). - View the Inspect > Network tab in your browser and search for
issues.json
request. Make sure it includes the paramproject=KEY
.🚧 Note: Since the backend is still WIP, this param will NOT filter properly. This MR only makes sure we make the right request, when the backend is ready it should return the correct results. - Repeat 3-4 for all the query params listed above.
- Play around with pagination, sort, label, search to make sure URL and
issues.json
request includes correct params.
Related to #442692 (closed)