Skip to content

Commit 74f6821

Browse files
gjabouley-invngonchik
authored andcommitted
Properly escape Jira project key for JQL queries (#928)
1 parent 79e8446 commit 74f6821

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

atlassian/jira.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,14 +2237,14 @@ def project_leaders(self):
22372237
}
22382238

22392239
def get_project_issuekey_last(self, project):
2240-
jql = "project = {project} ORDER BY issuekey DESC".format(project=project)
2240+
jql = 'project = "{project}" ORDER BY issuekey DESC'.format(project=project)
22412241
response = self.jql(jql)
22422242
if self.advanced_mode:
22432243
return response
22442244
return (response.get("issues") or {"key": None})[0]["key"]
22452245

22462246
def get_project_issuekey_all(self, project, start=0, limit=None, expand=None):
2247-
jql = "project = {project} ORDER BY issuekey ASC".format(project=project)
2247+
jql = 'project = "{project}" ORDER BY issuekey ASC'.format(project=project)
22482248
response = self.jql(jql, start=start, limit=limit, expand=expand)
22492249
if self.advanced_mode:
22502250
return response
@@ -2266,7 +2266,7 @@ def get_all_project_issues(self, project, fields="*all", start=0, limit=None):
22662266
:param limit: OPTIONAL int: Total number of project issues to be returned
22672267
:return: List of Dictionary for the Issue(s) returned.
22682268
"""
2269-
jql = "project = {project} ORDER BY key".format(project=project)
2269+
jql = 'project = "{project}" ORDER BY key'.format(project=project)
22702270
response = self.jql(jql, fields=fields, start=start, limit=limit)
22712271
if self.advanced_mode:
22722272
return response

0 commit comments

Comments
 (0)