Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote project key in JQL query and provide failure printing. #254

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MattLud
Copy link

@MattLud MattLud commented Feb 20, 2025

Context

Due to how JIRA project naming works, it will allow project keys with JQL reserved keywords. When used without quotes, the JQL will fail and throw an error message that you must quote them. Since quoting the project key has no downside, doing so will ensure compatibility regardless of project key.

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have verified that my code follows the style already available in the repository
  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

For some reason Jira allows you to create projects that are also JQL keywords. 

Even when using the project ID #, the API will end up using the key. 

The result is that the response contains an error: 

```
"Error in the JQL Query: 'DO' is a reserved JQL word. You must surround it in quotation marks to use it in a query. (line 1, character 13)"
```

Quoting the project key on the JQL should have no impacts and ensure that the proper query is done.
Prints the error returned by the JQL query if it fails.
@MattLud MattLud requested a review from a team as a code owner February 20, 2025 19:21
Copy link

changeset-bot bot commented Feb 20, 2025

⚠️ No Changeset found

Latest commit: 69374d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@anicke
Copy link
Contributor

anicke commented Feb 24, 2025

Thank you, please create a changeset. :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project keys using reserved JQL keywords silently fail to retrieve issues.
2 participants