Skip to content

Commit 983ab50

Browse files
committed
prepare a release
1 parent ff692bd commit 983ab50

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

atlassian/jira.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,18 +3346,15 @@ def jql(
33463346
:return:
33473347
"""
33483348
if self.cloud:
3349-
if start==0:
3349+
if start == 0:
33503350
return self.enhanced_jql(
33513351
jql=jql,
33523352
fields=fields,
33533353
limit=limit,
33543354
expand=expand,
33553355
)
33563356
else:
3357-
raise ValueError(
3358-
"The `jql` method is deprecated in Jira Cloud. Use `enhanced_jql` method instead."
3359-
)
3360-
3357+
raise ValueError("The `jql` method is deprecated in Jira Cloud. Use `enhanced_jql` method instead.")
33613358
params = {}
33623359
if start is not None:
33633360
params["startAt"] = int(start)
@@ -3397,7 +3394,6 @@ def enhanced_jql(
33973394

33983395
if not self.cloud:
33993396
raise ValueError("``enhanced_jql`` method is only available for Jira Cloud platform")
3400-
34013397
params = {}
34023398
if nextPageToken is not None:
34033399
params["nextPageToken"] = str(nextPageToken)
@@ -3411,7 +3407,6 @@ def enhanced_jql(
34113407
params["jql"] = jql
34123408
if expand is not None:
34133409
params["expand"] = expand
3414-
34153410
url = self.resource_url("search/jql")
34163411
return self.get(url, params=params)
34173412

@@ -3455,7 +3450,7 @@ def jql_get_list_of_tickets(
34553450
:return:
34563451
"""
34573452
if self.cloud:
3458-
if start==0:
3453+
if start == 0:
34593454
return self.enhanced_jql_get_list_of_tickets(
34603455
jql=jql,
34613456
fields=fields,
@@ -3488,7 +3483,7 @@ def jql_get_list_of_tickets(
34883483
response = self.get(url, params=params)
34893484
if not response:
34903485
break
3491-
3486+
34923487
issues = response["issues"]
34933488
results.extend(issues)
34943489
total = int(response["total"])
@@ -3536,21 +3531,20 @@ def enhanced_jql_get_list_of_tickets(
35363531

35373532
url = self.resource_url("search/jql")
35383533
results = []
3539-
nextPageToken = None
3534+
next_page_token = None
35403535

35413536
while True:
3542-
if nextPageToken is not None:
3543-
params["nextPageToken"] = nextPageToken
3537+
if next_page_token is not None:
3538+
params["nextPageToken"] = next_page_token
35443539

35453540
response = self.get(url, params=params)
35463541
if not response:
35473542
break
3548-
3543+
35493544
issues = response["issues"]
35503545
results.extend(issues)
3551-
3552-
nextPageToken = response.get("nextPageToken")
3553-
if not nextPageToken or (limit is not None and len(results) >= limit):
3546+
next_page_token = response.get("nextPageToken")
3547+
if not next_page_token or (limit is not None and len(results) >= limit):
35543548
break
35553549
return results
35563550

examples/jira/jira_search_issues_cloud.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
print(issue_count)
3030

3131
print("========== Fetching Issues Using enhanced_jql_get_list_of_tickets ==========")
32-
issues_list = jira_cloud.enhanced_jql_get_list_of_tickets("updated >= -1d ORDER BY updated DESC", limit=300, fields="*nav")
32+
issues_list = jira_cloud.enhanced_jql_get_list_of_tickets(
33+
"updated >= -1d ORDER BY updated DESC", limit=300, fields="*nav"
34+
)
3335
print(issues_list)
3436

3537
print("========== Done ==========")

0 commit comments

Comments
 (0)