fix(jira): auto-quote JQL reserved words in project key values#967
Merged
Conversation
When a project key matches a JQL reserved word (e.g., IF, AND, OR), Jira API returns "'IF' is a reserved JQL word" error. Add automatic quoting of reserved words in project = VALUE and project IN (...) patterns, mirroring the existing Confluence CQL pattern. - Add RESERVED_JQL_WORDS constant from official Atlassian docs - Add quote_jql_identifier_if_needed() and sanitize_jql_reserved_words() - Apply sanitization in search_issues() and get_board_issues() - Refactor projects_filter to use smart quoting (only when needed) Github-Issue:#966
b24ca5d to
d1bcfd0
Compare
sooperset
commented
Feb 23, 2026
Owner
Author
There was a problem hiding this comment.
Single-quote handling for both string literals and IN-clause values was missing in the initial version — now fixed. Implementation correctly mirrors the Confluence CQL pattern with proper JQL-specific adaptations. Reserved words list verified against official Atlassian docs. 1848 tests pass, lint/mypy clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IF,AND,OR) cause Jira API errors like"'IF' is a reserved JQL word"when used in raw JQL queriesRESERVED_JQL_WORDSconstant (from official Atlassian docs) andsanitize_jql_reserved_words()utility to auto-quote these values inproject = VALUEandproject IN (...)patternssearch_issues()andget_board_issues(), and refactorprojects_filterpath to use smart quoting viaquote_jql_identifier_if_needed()(only quotes when needed, not unconditionally)Test plan
quote_jql_identifier_if_needed()andsanitize_jql_reserved_words()intest_jql_utils.pysearch_issues()(Cloud + Server) andget_board_issues()projects_filtertests updated to match smart quoting behaviorCloses #966