atlassian-python-api 4.0.2__py3-none-any.whl → 4.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- atlassian/VERSION +1 -1
- atlassian/__init__.py +7 -1
- atlassian/assets.py +626 -0
- atlassian/bamboo.py +1 -0
- atlassian/bitbucket/__init__.py +0 -1
- atlassian/bitbucket/base.py +1 -1
- atlassian/bitbucket/cloud/__init__.py +5 -1
- atlassian/bitbucket/cloud/base.py +2 -2
- atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py +1 -1
- atlassian/cloud_admin.py +85 -0
- atlassian/confluence.py +131 -28
- atlassian/jira.py +84 -37
- atlassian/request_utils.py +3 -28
- atlassian/rest_client.py +8 -2
- {atlassian_python_api-4.0.2.dist-info → atlassian_python_api-4.0.4.dist-info}/METADATA +1 -2
- {atlassian_python_api-4.0.2.dist-info → atlassian_python_api-4.0.4.dist-info}/RECORD +19 -18
- {atlassian_python_api-4.0.2.dist-info → atlassian_python_api-4.0.4.dist-info}/WHEEL +1 -1
- {atlassian_python_api-4.0.2.dist-info → atlassian_python_api-4.0.4.dist-info}/licenses/LICENSE +0 -0
- {atlassian_python_api-4.0.2.dist-info → atlassian_python_api-4.0.4.dist-info}/top_level.txt +0 -0
atlassian/jira.py
CHANGED
|
@@ -470,7 +470,7 @@ class Jira(AtlassianRestAPI):
|
|
|
470
470
|
return self.put(url)
|
|
471
471
|
|
|
472
472
|
"""
|
|
473
|
-
Troubleshooting. (Available for DC) It gives the
|
|
473
|
+
Troubleshooting. (Available for DC) It gives the possibility to download support zips.
|
|
474
474
|
Reference: https://confluence.atlassian.com/support/create-a-support-zip-using-the-rest-api-in-data-center-applications-952054641.html
|
|
475
475
|
"""
|
|
476
476
|
|
|
@@ -1571,9 +1571,9 @@ class Jira(AtlassianRestAPI):
|
|
|
1571
1571
|
self,
|
|
1572
1572
|
issue_key: str,
|
|
1573
1573
|
fields: Union[str, dict],
|
|
1574
|
-
update: Optional[
|
|
1575
|
-
history_metadata: Optional[
|
|
1576
|
-
properties: Optional[
|
|
1574
|
+
update: Optional[Dict[Any, Any]] = None,
|
|
1575
|
+
history_metadata: Optional[Dict[Any, Any]] = None,
|
|
1576
|
+
properties: Optional[List[Any]] = None,
|
|
1577
1577
|
notify_users: bool = True,
|
|
1578
1578
|
):
|
|
1579
1579
|
"""
|
|
@@ -4050,7 +4050,7 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
4050
4050
|
permission_id: str,
|
|
4051
4051
|
name: str,
|
|
4052
4052
|
description: Optional[str] = None,
|
|
4053
|
-
permissions: Optional[
|
|
4053
|
+
permissions: Optional[List[dict]] = None,
|
|
4054
4054
|
scope: Optional[str] = None,
|
|
4055
4055
|
expand: Optional[str] = None,
|
|
4056
4056
|
):
|
|
@@ -4065,7 +4065,7 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
4065
4065
|
:param permission_id: int, REQUIRED: The ID of the permission scheme to update.
|
|
4066
4066
|
:param name: str, REQUIRED: The name of the permission scheme. Must be unique.
|
|
4067
4067
|
:param description: str, OPTIONAL: A description for the permission scheme. Defaults to None.
|
|
4068
|
-
:param permissions:
|
|
4068
|
+
:param permissions: List[dict], OPTIONAL: A collection of permission grants. Defaults to None.
|
|
4069
4069
|
Example:
|
|
4070
4070
|
[
|
|
4071
4071
|
{
|
|
@@ -4993,6 +4993,19 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
4993
4993
|
# Resource: https://docs.atlassian.com/jira-software/REST/7.3.1/
|
|
4994
4994
|
#######################################################################
|
|
4995
4995
|
# /rest/agile/1.0/backlog/issue
|
|
4996
|
+
def get_agile_resource_url(self, resource: str, legacy_api: bool = False) -> str:
|
|
4997
|
+
"""
|
|
4998
|
+
Prepare an 'Agile' API-specific URL relying on defaults set for the client.
|
|
4999
|
+
|
|
5000
|
+
:param resource: Name of an endpoint
|
|
5001
|
+
:param legacy_api: If True - use 'greenhopper' as an API type, else - use a newer, 'agile', name.
|
|
5002
|
+
:return: String with a full URL path to resource
|
|
5003
|
+
"""
|
|
5004
|
+
api_version = "1.0"
|
|
5005
|
+
api_type = "greenhopper" if legacy_api else "agile"
|
|
5006
|
+
api_root = self.api_root.replace("rest/api", f"rest/{api_type}")
|
|
5007
|
+
return self.resource_url(resource=resource, api_root=api_root, api_version=api_version)
|
|
5008
|
+
|
|
4996
5009
|
def move_issues_to_backlog(self, issue_keys: list) -> T_resp_json:
|
|
4997
5010
|
"""
|
|
4998
5011
|
Move issues to backlog
|
|
@@ -5012,7 +5025,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5012
5025
|
"""
|
|
5013
5026
|
if not isinstance(issues, list):
|
|
5014
5027
|
raise ValueError("`issues` param should be List of Issue Keys")
|
|
5015
|
-
|
|
5028
|
+
resource = "backlog/issue"
|
|
5029
|
+
url = self.get_agile_resource_url(resource)
|
|
5016
5030
|
data = dict(issues=issues)
|
|
5017
5031
|
return self.post(url, data=data)
|
|
5018
5032
|
|
|
@@ -5021,7 +5035,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5021
5035
|
Gets an agile board by the filter id
|
|
5022
5036
|
:param filter_id: int, str
|
|
5023
5037
|
"""
|
|
5024
|
-
|
|
5038
|
+
resource = f"board/filter/{filter_id}"
|
|
5039
|
+
url = self.get_agile_resource_url(resource)
|
|
5025
5040
|
return self.get(url)
|
|
5026
5041
|
|
|
5027
5042
|
# /rest/agile/1.0/board
|
|
@@ -5033,10 +5048,11 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5033
5048
|
:param filter_id: int
|
|
5034
5049
|
:param location: dict, Optional. Only specify this for Jira Cloud!
|
|
5035
5050
|
"""
|
|
5051
|
+
resource = "board"
|
|
5052
|
+
url = self.get_agile_resource_url(resource)
|
|
5036
5053
|
data: dict = {"name": name, "type": type, "filterId": filter_id}
|
|
5037
5054
|
if location:
|
|
5038
5055
|
data["location"] = location
|
|
5039
|
-
url = "rest/agile/1.0/board"
|
|
5040
5056
|
return self.post(url, data=data)
|
|
5041
5057
|
|
|
5042
5058
|
def get_all_agile_boards(
|
|
@@ -5056,7 +5072,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5056
5072
|
:param limit:
|
|
5057
5073
|
:return:
|
|
5058
5074
|
"""
|
|
5059
|
-
|
|
5075
|
+
resource = "board"
|
|
5076
|
+
url = self.get_agile_resource_url(resource)
|
|
5060
5077
|
params: dict = {}
|
|
5061
5078
|
if board_name:
|
|
5062
5079
|
params["name"] = board_name
|
|
@@ -5077,7 +5094,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5077
5094
|
:param board_id:
|
|
5078
5095
|
:return:
|
|
5079
5096
|
"""
|
|
5080
|
-
|
|
5097
|
+
resource = f"board/{board_id}"
|
|
5098
|
+
url = self.get_agile_resource_url(resource)
|
|
5081
5099
|
return self.delete(url)
|
|
5082
5100
|
|
|
5083
5101
|
def get_agile_board(self, board_id: T_id) -> T_resp_json:
|
|
@@ -5086,7 +5104,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5086
5104
|
:param board_id:
|
|
5087
5105
|
:return:
|
|
5088
5106
|
"""
|
|
5089
|
-
|
|
5107
|
+
resource = f"board/{board_id}"
|
|
5108
|
+
url = self.get_agile_resource_url(resource)
|
|
5090
5109
|
return self.get(url)
|
|
5091
5110
|
|
|
5092
5111
|
def get_issues_for_backlog(self, board_id: T_id) -> T_resp_json:
|
|
@@ -5099,7 +5118,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5099
5118
|
By default, the returned issues are ordered by rank.
|
|
5100
5119
|
:param board_id: int, str
|
|
5101
5120
|
"""
|
|
5102
|
-
|
|
5121
|
+
resource = f"board/{board_id}/backlog"
|
|
5122
|
+
url = self.get_agile_resource_url(resource)
|
|
5103
5123
|
return self.get(url)
|
|
5104
5124
|
|
|
5105
5125
|
def get_agile_board_configuration(self, board_id: T_id) -> T_resp_json:
|
|
@@ -5126,7 +5146,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5126
5146
|
:param board_id:
|
|
5127
5147
|
:return:
|
|
5128
5148
|
"""
|
|
5129
|
-
|
|
5149
|
+
resource = f"board/{board_id}/configuration"
|
|
5150
|
+
url = self.get_agile_resource_url(resource)
|
|
5130
5151
|
return self.get(url)
|
|
5131
5152
|
|
|
5132
5153
|
def get_issues_for_board(
|
|
@@ -5153,6 +5174,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5153
5174
|
:param expand: OPTIONAL: expand the search result
|
|
5154
5175
|
:return:
|
|
5155
5176
|
"""
|
|
5177
|
+
resource = f"board/{board_id}/issue"
|
|
5178
|
+
url = self.get_agile_resource_url(resource)
|
|
5156
5179
|
params: dict = {}
|
|
5157
5180
|
if start is not None:
|
|
5158
5181
|
params["startAt"] = int(start)
|
|
@@ -5167,7 +5190,6 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5167
5190
|
if expand is not None:
|
|
5168
5191
|
params["expand"] = expand
|
|
5169
5192
|
|
|
5170
|
-
url = f"rest/agile/1.0/board/{board_id}/issue"
|
|
5171
5193
|
return self.get(url, params=params)
|
|
5172
5194
|
|
|
5173
5195
|
# /rest/agile/1.0/board/{boardId}/epic
|
|
@@ -5190,7 +5212,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5190
5212
|
See the 'Pagination' section at the top of this page for more details.
|
|
5191
5213
|
:return:
|
|
5192
5214
|
"""
|
|
5193
|
-
|
|
5215
|
+
resource = f"board/{board_id}/epic"
|
|
5216
|
+
url = self.get_agile_resource_url(resource)
|
|
5194
5217
|
params: dict = {}
|
|
5195
5218
|
if done:
|
|
5196
5219
|
params["done"] = done
|
|
@@ -5236,7 +5259,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5236
5259
|
If you exceed this limit, your results will be truncated.
|
|
5237
5260
|
:return:
|
|
5238
5261
|
"""
|
|
5239
|
-
|
|
5262
|
+
resource = f"board/{board_id}/epic/{epic_id}/issue"
|
|
5263
|
+
url = self.get_agile_resource_url(resource)
|
|
5240
5264
|
params: dict = {}
|
|
5241
5265
|
if jql:
|
|
5242
5266
|
params["jql"] = jql
|
|
@@ -5285,7 +5309,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5285
5309
|
If you exceed this limit, your results will be truncated.
|
|
5286
5310
|
:return:
|
|
5287
5311
|
"""
|
|
5288
|
-
|
|
5312
|
+
resource = f"board/{board_id}/epic/none/issue"
|
|
5313
|
+
url = self.get_agile_resource_url(resource)
|
|
5289
5314
|
params: dict = {}
|
|
5290
5315
|
if jql:
|
|
5291
5316
|
params["jql"] = jql
|
|
@@ -5321,7 +5346,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5321
5346
|
See the 'Pagination' section at the top of this page for more details
|
|
5322
5347
|
:return:
|
|
5323
5348
|
"""
|
|
5324
|
-
|
|
5349
|
+
resource = f"board/{board_id}/project"
|
|
5350
|
+
url = self.get_agile_resource_url(resource)
|
|
5325
5351
|
params: dict = {}
|
|
5326
5352
|
if start:
|
|
5327
5353
|
params["startAt"] = start
|
|
@@ -5336,7 +5362,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5336
5362
|
The user who retrieves the property keys is required to have permissions to view the board.
|
|
5337
5363
|
:param board_id: int, str
|
|
5338
5364
|
"""
|
|
5339
|
-
|
|
5365
|
+
resource = f"board/{board_id}/properties"
|
|
5366
|
+
url = self.get_agile_resource_url(resource)
|
|
5340
5367
|
return self.get(url)
|
|
5341
5368
|
|
|
5342
5369
|
def set_agile_board_property(self, board_id: T_id, property_key: str) -> T_resp_json:
|
|
@@ -5349,7 +5376,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5349
5376
|
:param property_key:
|
|
5350
5377
|
:return:
|
|
5351
5378
|
"""
|
|
5352
|
-
|
|
5379
|
+
resource = f"board/{board_id}/properties/{property_key}"
|
|
5380
|
+
url = self.get_agile_resource_url(resource)
|
|
5353
5381
|
return self.put(url)
|
|
5354
5382
|
|
|
5355
5383
|
def get_agile_board_property(self, board_id: T_id, property_key: str) -> T_resp_json:
|
|
@@ -5360,7 +5388,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5360
5388
|
:param property_key:
|
|
5361
5389
|
:return:
|
|
5362
5390
|
"""
|
|
5363
|
-
|
|
5391
|
+
resource = f"board/{board_id}/properties/{property_key}"
|
|
5392
|
+
url = self.get_agile_resource_url(resource)
|
|
5364
5393
|
return self.get(url)
|
|
5365
5394
|
|
|
5366
5395
|
def delete_agile_board_property(self, board_id: T_id, property_key: str) -> T_resp_json:
|
|
@@ -5371,7 +5400,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5371
5400
|
:param property_key:
|
|
5372
5401
|
:return:
|
|
5373
5402
|
"""
|
|
5374
|
-
|
|
5403
|
+
resource = f"board/{board_id}/properties/{property_key}"
|
|
5404
|
+
url = self.get_agile_resource_url(resource)
|
|
5375
5405
|
return self.delete(url)
|
|
5376
5406
|
|
|
5377
5407
|
# /rest/agile/1.0/board/{boardId}/settings/refined-velocity
|
|
@@ -5381,7 +5411,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5381
5411
|
:param board_id:
|
|
5382
5412
|
:return:
|
|
5383
5413
|
"""
|
|
5384
|
-
|
|
5414
|
+
resource = f"board/{board_id}/settings/refined-velocity"
|
|
5415
|
+
url = self.get_agile_resource_url(resource)
|
|
5385
5416
|
return self.get(url)
|
|
5386
5417
|
|
|
5387
5418
|
def set_agile_board_refined_velocity(self, board_id: T_id, data: dict) -> T_resp_json:
|
|
@@ -5391,7 +5422,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5391
5422
|
:param data:
|
|
5392
5423
|
:return:
|
|
5393
5424
|
"""
|
|
5394
|
-
|
|
5425
|
+
resource = f"board/{board_id}/settings/refined-velocity"
|
|
5426
|
+
url = self.get_agile_resource_url(resource)
|
|
5395
5427
|
return self.put(url, data=data)
|
|
5396
5428
|
|
|
5397
5429
|
# /rest/agile/1.0/board/{boardId}/sprint
|
|
@@ -5414,6 +5446,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5414
5446
|
See the 'Pagination' section at the top of this page for more details.
|
|
5415
5447
|
:return:
|
|
5416
5448
|
"""
|
|
5449
|
+
resource = f"board/{board_id}/sprint"
|
|
5450
|
+
url = self.get_agile_resource_url(resource)
|
|
5417
5451
|
params: dict = {}
|
|
5418
5452
|
if start:
|
|
5419
5453
|
params["startAt"] = start
|
|
@@ -5421,7 +5455,6 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5421
5455
|
params["maxResults"] = limit
|
|
5422
5456
|
if state:
|
|
5423
5457
|
params["state"] = state
|
|
5424
|
-
url = f"rest/agile/1.0/board/{board_id}/sprint"
|
|
5425
5458
|
return self.get(url, params=params)
|
|
5426
5459
|
|
|
5427
5460
|
@deprecated(version="3.42.0", reason="Use get_all_sprints_from_board instead")
|
|
@@ -5472,7 +5505,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5472
5505
|
'jira.search.views.default.max' in your JIRA instance.
|
|
5473
5506
|
If you exceed this limit, your results will be truncated.
|
|
5474
5507
|
"""
|
|
5475
|
-
|
|
5508
|
+
resource = f"board/{board_id}/sprint/{sprint_id}/issue"
|
|
5509
|
+
url = self.get_agile_resource_url(resource)
|
|
5476
5510
|
params: dict = {}
|
|
5477
5511
|
if jql:
|
|
5478
5512
|
params["jql"] = jql
|
|
@@ -5510,6 +5544,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5510
5544
|
See the 'Pagination' section at the top of this page for more details.
|
|
5511
5545
|
:return:
|
|
5512
5546
|
"""
|
|
5547
|
+
resource = f"board/{board_id}/version"
|
|
5548
|
+
url = self.get_agile_resource_url(resource)
|
|
5513
5549
|
params: dict = {}
|
|
5514
5550
|
if released:
|
|
5515
5551
|
params["released"] = released
|
|
@@ -5517,7 +5553,6 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5517
5553
|
params["startAt"] = start
|
|
5518
5554
|
if limit:
|
|
5519
5555
|
params["maxResults"] = limit
|
|
5520
|
-
url = f"rest/agile/1.0/board/{board_id}/version"
|
|
5521
5556
|
return self.get(url, params=params)
|
|
5522
5557
|
|
|
5523
5558
|
def create_sprint(
|
|
@@ -5544,7 +5579,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5544
5579
|
https://docs.atlassian.com/jira-software/REST/8.9.0/#agile/1.0/sprint
|
|
5545
5580
|
isoformat can be created with datetime.datetime.isoformat()
|
|
5546
5581
|
"""
|
|
5547
|
-
|
|
5582
|
+
resource = "sprint"
|
|
5583
|
+
url = self.get_agile_resource_url(resource)
|
|
5548
5584
|
data = dict(name=name, originBoardId=board_id)
|
|
5549
5585
|
if start_date:
|
|
5550
5586
|
data["startDate"] = start_date
|
|
@@ -5580,7 +5616,8 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5580
5616
|
:param sprint_id:
|
|
5581
5617
|
:return:
|
|
5582
5618
|
"""
|
|
5583
|
-
|
|
5619
|
+
resource = f"sprint/{sprint_id}"
|
|
5620
|
+
url = self.get_agile_resource_url(resource)
|
|
5584
5621
|
return self.get(url)
|
|
5585
5622
|
|
|
5586
5623
|
def rename_sprint(self, sprint_id: T_id, name: str, start_date: str, end_date: str) -> T_resp_json:
|
|
@@ -5592,8 +5629,10 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5592
5629
|
:param end_date:
|
|
5593
5630
|
:return:
|
|
5594
5631
|
"""
|
|
5632
|
+
resource = f"sprint/{sprint_id}"
|
|
5633
|
+
url = self.get_agile_resource_url(resource, legacy_api=True)
|
|
5595
5634
|
return self.put(
|
|
5596
|
-
|
|
5635
|
+
url,
|
|
5597
5636
|
data={"name": name, "startDate": start_date, "endDate": end_date},
|
|
5598
5637
|
)
|
|
5599
5638
|
|
|
@@ -5605,7 +5644,9 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5605
5644
|
:param sprint_id:
|
|
5606
5645
|
:return:
|
|
5607
5646
|
"""
|
|
5608
|
-
|
|
5647
|
+
resource = f"sprint/{sprint_id}"
|
|
5648
|
+
url = self.get_agile_resource_url(resource)
|
|
5649
|
+
return self.delete(url)
|
|
5609
5650
|
|
|
5610
5651
|
def update_partially_sprint(self, sprint_id: T_id, data: dict) -> T_resp_json:
|
|
5611
5652
|
"""
|
|
@@ -5625,7 +5666,9 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5625
5666
|
:param data: { "name": "new name"}
|
|
5626
5667
|
:return:
|
|
5627
5668
|
"""
|
|
5628
|
-
|
|
5669
|
+
resource = f"sprint/{sprint_id}"
|
|
5670
|
+
url = self.get_agile_resource_url(resource)
|
|
5671
|
+
return self.post(url, data=data)
|
|
5629
5672
|
|
|
5630
5673
|
def get_sprint_issues(self, sprint_id: T_id, start: T_id, limit: T_id) -> T_resp_json:
|
|
5631
5674
|
"""
|
|
@@ -5644,12 +5687,13 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5644
5687
|
If you exceed this limit, your results will be truncated.
|
|
5645
5688
|
:return:
|
|
5646
5689
|
"""
|
|
5690
|
+
resource = f"sprint/{sprint_id}/issue"
|
|
5691
|
+
url = self.get_agile_resource_url(resource)
|
|
5647
5692
|
params: dict = {}
|
|
5648
5693
|
if start:
|
|
5649
5694
|
params["startAt"] = start
|
|
5650
5695
|
if limit:
|
|
5651
5696
|
params["maxResults"] = limit
|
|
5652
|
-
url = f"rest/agile/1.0/sprint/{sprint_id}/issue"
|
|
5653
5697
|
return self.get(url, params=params)
|
|
5654
5698
|
|
|
5655
5699
|
def update_rank(self, issues_to_rank: list, rank_before: str, customfield_number: T_id) -> T_resp_json:
|
|
@@ -5660,9 +5704,11 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5660
5704
|
:param customfield_number: The number of the custom field Rank
|
|
5661
5705
|
:return:
|
|
5662
5706
|
"""
|
|
5707
|
+
resource = "issue/rank"
|
|
5708
|
+
url = self.get_agile_resource_url(resource)
|
|
5663
5709
|
|
|
5664
5710
|
return self.put(
|
|
5665
|
-
|
|
5711
|
+
url,
|
|
5666
5712
|
data={
|
|
5667
5713
|
"issues": issues_to_rank,
|
|
5668
5714
|
"rankBeforeIssue": rank_before,
|
|
@@ -5692,13 +5738,14 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5692
5738
|
"""
|
|
5693
5739
|
Flags or un-flags one or multiple issues in Jira with a flag indicator.
|
|
5694
5740
|
:param issue_keys: List of issue keys to flag or un-flag.
|
|
5695
|
-
:type issue_keys:
|
|
5741
|
+
:type issue_keys: List[str]
|
|
5696
5742
|
:param flag: Flag indicating whether to flag or un-flag the issues (default is True for flagging).
|
|
5697
5743
|
:type flag: bool
|
|
5698
5744
|
:return: POST request response.
|
|
5699
5745
|
:rtype: dict
|
|
5700
5746
|
"""
|
|
5701
|
-
|
|
5747
|
+
resource = "xboard/issue/flag/flag.json"
|
|
5748
|
+
url = self.get_agile_resource_url(resource, legacy_api=True)
|
|
5702
5749
|
data = {"issueKeys": issue_keys, "flag": flag}
|
|
5703
5750
|
return self.post(url, data)
|
|
5704
5751
|
|
atlassian/request_utils.py
CHANGED
|
@@ -1,39 +1,14 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from six import PY3
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Additional log methods
|
|
7
|
-
def logger_has_handlers(logger):
|
|
8
|
-
"""Since Python 2 doesn't provide Logger.hasHandlers(), we have to
|
|
9
|
-
perform the lookup by ourselves."""
|
|
10
|
-
|
|
11
|
-
if PY3:
|
|
12
|
-
return logger.hasHandlers()
|
|
13
|
-
else:
|
|
14
|
-
c = logger
|
|
15
|
-
rv = False
|
|
16
|
-
while c:
|
|
17
|
-
if c.handlers:
|
|
18
|
-
rv = True
|
|
19
|
-
break
|
|
20
|
-
if not c.propagate:
|
|
21
|
-
break
|
|
22
|
-
else:
|
|
23
|
-
c = c.parent
|
|
24
|
-
return rv
|
|
25
|
-
|
|
26
3
|
|
|
27
4
|
def get_default_logger(name):
|
|
28
5
|
"""Get a logger from default logging manager. If no handler
|
|
29
6
|
is associated, add a default NullHandler"""
|
|
30
7
|
|
|
31
8
|
logger = logging.getLogger(name)
|
|
32
|
-
if not
|
|
9
|
+
if not logger.hasHandlers():
|
|
33
10
|
# If logging is not configured in the current project, configure
|
|
34
|
-
# this logger to discard all logs messages. This will
|
|
35
|
-
#
|
|
36
|
-
# and avoid redirecting errors to the default 'lastResort'
|
|
37
|
-
# StreamHandler on Python 3
|
|
11
|
+
# this logger to discard all logs messages. This will avoid
|
|
12
|
+
# redirecting errors to the default 'lastResort' StreamHandler
|
|
38
13
|
logger.addHandler(logging.NullHandler())
|
|
39
14
|
return logger
|
atlassian/rest_client.py
CHANGED
|
@@ -12,6 +12,7 @@ from typing import (
|
|
|
12
12
|
Union,
|
|
13
13
|
overload,
|
|
14
14
|
)
|
|
15
|
+
from urllib.parse import urlencode
|
|
15
16
|
|
|
16
17
|
import requests
|
|
17
18
|
import urllib3
|
|
@@ -27,7 +28,6 @@ except ImportError:
|
|
|
27
28
|
|
|
28
29
|
from requests import HTTPError, Response, Session
|
|
29
30
|
from requests_oauthlib import OAuth1, OAuth2
|
|
30
|
-
from six.moves.urllib.parse import urlencode
|
|
31
31
|
from typing_extensions import Self
|
|
32
32
|
from urllib3.util import Retry
|
|
33
33
|
|
|
@@ -95,6 +95,7 @@ class AtlassianRestAPI(object):
|
|
|
95
95
|
backoff_factor=1.0,
|
|
96
96
|
backoff_jitter=1.0,
|
|
97
97
|
retry_with_header=True,
|
|
98
|
+
header=None,
|
|
98
99
|
):
|
|
99
100
|
"""
|
|
100
101
|
init function for the AtlassianRestAPI object.
|
|
@@ -197,6 +198,8 @@ class AtlassianRestAPI(object):
|
|
|
197
198
|
self._create_kerberos_session(kerberos)
|
|
198
199
|
elif cookies is not None:
|
|
199
200
|
self._session.cookies.update(cookies)
|
|
201
|
+
elif header is not None:
|
|
202
|
+
self._create_header_session(header)
|
|
200
203
|
|
|
201
204
|
def __enter__(self) -> Self:
|
|
202
205
|
return self
|
|
@@ -210,7 +213,10 @@ class AtlassianRestAPI(object):
|
|
|
210
213
|
def _create_token_session(self, token: str) -> None:
|
|
211
214
|
self._update_header("Authorization", f"Bearer {token.strip()}")
|
|
212
215
|
|
|
213
|
-
def
|
|
216
|
+
def _create_header_session(self, header: dict) -> None:
|
|
217
|
+
self._session.headers.update(header)
|
|
218
|
+
|
|
219
|
+
def _create_kerberos_session(self, _):
|
|
214
220
|
from requests_kerberos import OPTIONAL, HTTPKerberosAuth
|
|
215
221
|
|
|
216
222
|
self._session.auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atlassian-python-api
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.4
|
|
4
4
|
Summary: Python Atlassian REST API Wrapper
|
|
5
5
|
Home-page: https://github.com/atlassian-api/atlassian-python-api
|
|
6
6
|
Download-URL: https://github.com/atlassian-api/atlassian-python-api
|
|
@@ -41,7 +41,6 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
|
41
41
|
License-File: LICENSE
|
|
42
42
|
Requires-Dist: deprecated
|
|
43
43
|
Requires-Dist: requests
|
|
44
|
-
Requires-Dist: six
|
|
45
44
|
Requires-Dist: oauthlib
|
|
46
45
|
Requires-Dist: requests_oauthlib
|
|
47
46
|
Requires-Dist: jmespath
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
atlassian/VERSION,sha256=
|
|
2
|
-
atlassian/__init__.py,sha256=
|
|
3
|
-
atlassian/
|
|
4
|
-
atlassian/
|
|
5
|
-
atlassian/
|
|
1
|
+
atlassian/VERSION,sha256=BUWrE3vwGh4ju-66o40bVH0h2u09uw_rI1ndBpj4XPw,5
|
|
2
|
+
atlassian/__init__.py,sha256=CpswvfzfMsXkY0aaM-ywYqsVE82OJrLiFCFOFDTt8qI,906
|
|
3
|
+
atlassian/assets.py,sha256=P3Cm9UnR1dbcoRm0uZvOnZzcY2TSxJ_iH2llYqEF7Ck,21611
|
|
4
|
+
atlassian/bamboo.py,sha256=-KlqEJsMV1ZsM-em-6NmuU1JjBrO7seu07I5byus2rY,48018
|
|
5
|
+
atlassian/cloud_admin.py,sha256=pRLPR1-pOdvnH-H56PxtTrtW1ok_HrM2LCmvsyLlzss,4054
|
|
6
|
+
atlassian/confluence.py,sha256=8x-YOb3v9qy-7G2RWyekFWwy1djLPsAR5TqYM3xHrb4,144666
|
|
6
7
|
atlassian/crowd.py,sha256=hsLqcmKLm-qWK3xV1pDYCeGcvUIR8k6DJkMlwcDn8QM,9255
|
|
7
8
|
atlassian/errors.py,sha256=GAKr6W4zPn7ZUMRLHG8-UgAdVnxDzKVZ-jyGXAccALE,398
|
|
8
9
|
atlassian/insight.py,sha256=fCR9IXmatTp6-l-pOeLFFQGgBeafSzBdkgIHLWkOXEo,23398
|
|
9
|
-
atlassian/jira.py,sha256=
|
|
10
|
+
atlassian/jira.py,sha256=AFYq8YUkoHf6v9un7A4QGnFMFQQ-gjdgqaNyxsYTLPc,226640
|
|
10
11
|
atlassian/marketplace.py,sha256=dLm4I8GROkdhyu3BdGtK_ssq1g44KZFi8S0HS_ZepLs,2540
|
|
11
12
|
atlassian/portfolio.py,sha256=q38sFFC7DHmHM4vsFzl8sT7HcRRGKH3tT5nRlqltDzc,3696
|
|
12
13
|
atlassian/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
atlassian/request_utils.py,sha256=
|
|
14
|
-
atlassian/rest_client.py,sha256=
|
|
14
|
+
atlassian/request_utils.py,sha256=eDWGtbbhGGoqQOqqqclaO7vuJRexzIZeTAYu7aluDuw,510
|
|
15
|
+
atlassian/rest_client.py,sha256=720jRpJ-Fq6lKNQsom4BomD2XEnzgtjE9JjTeFh52uI,34086
|
|
15
16
|
atlassian/service_desk.py,sha256=gPC2fehnrFvWLA-mg0Ca_l3GzHd5PG_1m7OCTApqTC8,32987
|
|
16
17
|
atlassian/statuspage.py,sha256=4zXsrpPVgbaOmBoS7GBgaO389rUnuCwKeSwEVS-SFyg,93560
|
|
17
18
|
atlassian/typehints.py,sha256=zmAjrhp5kjiquAEYZiv1iPXCaq5GqWYrdpLXeeILYuQ,180
|
|
18
19
|
atlassian/utils.py,sha256=3Qm_UCn0pDgLZOKle4IeG6-9zXz0bu-_x4rXb5Iczpg,10897
|
|
19
20
|
atlassian/xray.py,sha256=JjTcYevIwYXb3B3PUQJdZDjRRo2vcCW01qq0Wo5daRk,26991
|
|
20
|
-
atlassian/bitbucket/__init__.py,sha256=
|
|
21
|
-
atlassian/bitbucket/base.py,sha256=
|
|
22
|
-
atlassian/bitbucket/cloud/__init__.py,sha256=
|
|
23
|
-
atlassian/bitbucket/cloud/base.py,sha256=
|
|
21
|
+
atlassian/bitbucket/__init__.py,sha256=bh7i8yjgCpyxz1VGCALqDdjsPrlWe5zV-xXXCg0bGnc,135925
|
|
22
|
+
atlassian/bitbucket/base.py,sha256=z_8fX2w2r_MClMMmrm4rM5JrNoY0pIc07rFvPhuZU0E,6489
|
|
23
|
+
atlassian/bitbucket/cloud/__init__.py,sha256=IDw6mMXXaI_KipT08Ff5duS2NiKoSX1F0HqZKsilJQA,851
|
|
24
|
+
atlassian/bitbucket/cloud/base.py,sha256=zG50qqMgqyV2KJdUxn5KIdTBLA26wq0-Tk1gyBq8k9g,4267
|
|
24
25
|
atlassian/bitbucket/cloud/common/__init__.py,sha256=xhpE0cKTpx6a1jjazmjIexNFuq0a5gpzefmM_NnH7fw,37
|
|
25
26
|
atlassian/bitbucket/cloud/common/builds.py,sha256=S9Ox26WDiFjdHU9XqEVQz7ddC4LV3f4h55L9-ITIAnE,2374
|
|
26
27
|
atlassian/bitbucket/cloud/common/comments.py,sha256=ktnN9G0Vr49rIAeqTElnEXvpePp6roUw_Om06JnEb-4,1329
|
|
@@ -29,7 +30,7 @@ atlassian/bitbucket/cloud/repositories/__init__.py,sha256=WoSIpOWpz8KHTsa9RjQFFe
|
|
|
29
30
|
atlassian/bitbucket/cloud/repositories/branchRestrictions.py,sha256=Gr0_DYIQHtd2lyVEBqUiUXg6Y_xumRn10UgKo6iF8ck,6535
|
|
30
31
|
atlassian/bitbucket/cloud/repositories/commits.py,sha256=RvwTr7dMzQEuuZ6DFMfCfPhv33o7r1rtsPIT5es16dI,7752
|
|
31
32
|
atlassian/bitbucket/cloud/repositories/defaultReviewers.py,sha256=MLjjZP8wkIX8wYh87IpXrYXUVgZcld8AbJU1AC1u-VE,3592
|
|
32
|
-
atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py,sha256=
|
|
33
|
+
atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py,sha256=eouHjBORdEJSyuccUy2Gsdm-ZdKkvJ7oJmj8P6fWtKk,9385
|
|
33
34
|
atlassian/bitbucket/cloud/repositories/diffstat.py,sha256=tzi9mDC71Jps-Lj_UdvR3mUb1nFlbN2DZ1bjHfGu26A,2893
|
|
34
35
|
atlassian/bitbucket/cloud/repositories/groupPermissions.py,sha256=yMSlQKvrQ5rFx3eD-pJuMR2QdzotTAAV8KCR6KOGHU4,2696
|
|
35
36
|
atlassian/bitbucket/cloud/repositories/hooks.py,sha256=quPT8F9la2Vz5Rh-CUsUwC7V_7U3Zv9VSTSmcDGX9_w,3193
|
|
@@ -49,8 +50,8 @@ atlassian/bitbucket/server/common/__init__.py,sha256=woZpR3WXAA3A99hZ1UZI_gLPHaA
|
|
|
49
50
|
atlassian/bitbucket/server/common/permissions.py,sha256=ve-hWRIrG0zSMo1hp2uTLHGO1PlXorzZlpt7Sc9KhJw,7300
|
|
50
51
|
atlassian/bitbucket/server/projects/__init__.py,sha256=6G3MZBOTFpwx5x3chg-M8-BbmOnrdRZiZYp2YKJScbw,7668
|
|
51
52
|
atlassian/bitbucket/server/projects/repos/__init__.py,sha256=RFnZ5APax9VXASYbHbMjW12L2NR4gWbXzS-c-KyExTI,10776
|
|
52
|
-
atlassian_python_api-4.0.
|
|
53
|
-
atlassian_python_api-4.0.
|
|
54
|
-
atlassian_python_api-4.0.
|
|
55
|
-
atlassian_python_api-4.0.
|
|
56
|
-
atlassian_python_api-4.0.
|
|
53
|
+
atlassian_python_api-4.0.4.dist-info/licenses/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
|
|
54
|
+
atlassian_python_api-4.0.4.dist-info/METADATA,sha256=GLBmpuqg276axHZX9mMzW4mn3tVi3XSMqcX3c4k7r0c,9500
|
|
55
|
+
atlassian_python_api-4.0.4.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
56
|
+
atlassian_python_api-4.0.4.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
|
|
57
|
+
atlassian_python_api-4.0.4.dist-info/RECORD,,
|
{atlassian_python_api-4.0.2.dist-info → atlassian_python_api-4.0.4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|