Quote project key in Jira JQL queries
What does this MR do and why?
These queries fail when the project key is set to a reserved word like
INT
, so we have to put it in quotation marks.
Prompted by this Slack conversation (internal):
I’m helping a customer that’s receiving a
Projects::Integrations::Jira::IssuesFinder::RequestError
exception when attempting to fetch JIRA issues from GitLab. Connection is okay and other projects can fetch issues without problem. The exception above points to an incorrect Project Key in use. The Project Key however matches what’s on the JIRA side. After some testing I believe I was able to recreate this and apparently we error out when the Project Key is set toINT
(this is the key the customer is using). So even if the key is correct, if it’s set toINT
it fails, can somebody check and confirm this or see if I’m just seeing things?
Confirmed with a request like https://qa-toupeira.atlassian.net/rest/api/2/search?jql=project+%3D+INT:
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Set up a Jira project with the key
INT
(renaming an existing one seems to work too) - Set up a GitLab project with the Jira integration, check
Enable Jira issues
(needs EE), and set the project key toINT
- Go to Issues → Jira issues
- Verify that no error message appears
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.