Skip to content

Properly escape Jira project key for JQL queries #928

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -2237,14 +2237,14 @@ def project_leaders(self):
}

def get_project_issuekey_last(self, project):
jql = "project = {project} ORDER BY issuekey DESC".format(project=project)
jql = 'project = "{project}" ORDER BY issuekey DESC'.format(project=project)
response = self.jql(jql)
if self.advanced_mode:
return response
return (response.get("issues") or {"key": None})[0]["key"]

def get_project_issuekey_all(self, project, start=0, limit=None, expand=None):
jql = "project = {project} ORDER BY issuekey ASC".format(project=project)
jql = 'project = "{project}" ORDER BY issuekey ASC'.format(project=project)
response = self.jql(jql, start=start, limit=limit, expand=expand)
if self.advanced_mode:
return response
Expand All @@ -2266,7 +2266,7 @@ def get_all_project_issues(self, project, fields="*all", start=0, limit=None):
:param limit: OPTIONAL int: Total number of project issues to be returned
:return: List of Dictionary for the Issue(s) returned.
"""
jql = "project = {project} ORDER BY key".format(project=project)
jql = 'project = "{project}" ORDER BY key'.format(project=project)
response = self.jql(jql, fields=fields, start=start, limit=limit)
if self.advanced_mode:
return response
Expand Down