atlassian-python-api 5.0.1__py3-none-any.whl → 5.0.2__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 +13 -2
- atlassian/assets.py +10 -3
- atlassian/bamboo.py +178 -2
- atlassian/bitbucket/__init__.py +87 -1
- atlassian/bitbucket/base.py +9 -2
- atlassian/bitbucket/server/__init__.py +11 -0
- atlassian/cloud_admin.py +418 -0
- atlassian/confluence/__init__.py +9 -0
- atlassian/confluence/base.py +32 -10
- atlassian/confluence/cloud/__init__.py +19 -0
- atlassian/confluence/cloud/classification_levels.py +77 -0
- atlassian/confluence/cloud/cloud.py +43 -5
- atlassian/confluence/cloud/content_properties.py +71 -0
- atlassian/confluence/cloud/graphql.py +99 -0
- atlassian/confluence/server/__init__.py +274 -74
- atlassian/crowd.py +78 -0
- atlassian/jira/__init__.py +21 -0
- atlassian/jira/core_methods.py +11698 -0
- atlassian/jira/jira_cloud.py +160 -0
- atlassian/{jira.py → jira/jira_server.py} +333 -6
- atlassian/jira/service_management_methods.py +1381 -0
- atlassian/jira/software_methods.py +2114 -0
- atlassian/rest_client.py +26 -1
- atlassian/service_desk.py +10 -3
- atlassian/yogi/__init__.py +17 -0
- atlassian/yogi/base.py +11 -0
- atlassian/yogi/cloud.py +2367 -0
- atlassian/yogi/yogi_confluence_cloud.py +10 -0
- atlassian/yogi/yogi_confluence_dc.py +94 -0
- atlassian/yogi/yogi_jira_cloud.py +10 -0
- atlassian/yogi/yogi_jira_dc.py +64 -0
- {atlassian_python_api-5.0.1.dist-info → atlassian_python_api-5.0.2.dist-info}/METADATA +80 -10
- {atlassian_python_api-5.0.1.dist-info → atlassian_python_api-5.0.2.dist-info}/RECORD +37 -22
- {atlassian_python_api-5.0.1.dist-info → atlassian_python_api-5.0.2.dist-info}/WHEEL +0 -0
- {atlassian_python_api-5.0.1.dist-info → atlassian_python_api-5.0.2.dist-info}/licenses/LICENSE +0 -0
- {atlassian_python_api-5.0.1.dist-info → atlassian_python_api-5.0.2.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
|
+
# Jira Server/Data Center compatibility implementation.
|
|
2
3
|
import logging
|
|
3
4
|
import os
|
|
4
5
|
import re
|
|
5
6
|
import zipfile
|
|
7
|
+
from json import dumps
|
|
6
8
|
from typing import Any, BinaryIO, Dict, List, Optional, Union, cast
|
|
7
9
|
from warnings import warn
|
|
8
10
|
|
|
@@ -14,9 +16,9 @@ if sys.version_info >= (3, 8):
|
|
|
14
16
|
from typing import Literal # Python 3.8+
|
|
15
17
|
else:
|
|
16
18
|
from typing_extensions import Literal # Python <=3.7
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
19
|
+
from ..errors import ApiNotFoundError, ApiPermissionError
|
|
20
|
+
from ..rest_client import AtlassianRestAPI
|
|
21
|
+
from ..typehints import T_id, T_resp_json, copy_type
|
|
20
22
|
|
|
21
23
|
log = logging.getLogger(__name__)
|
|
22
24
|
|
|
@@ -230,6 +232,30 @@ class Jira(AtlassianRestAPI):
|
|
|
230
232
|
url = f"{base_url}/{role_key}"
|
|
231
233
|
return self.get(url) or {}
|
|
232
234
|
|
|
235
|
+
def update_application_roles(
|
|
236
|
+
self, application_roles: List[Dict[str, Any]], if_match: Optional[str] = None
|
|
237
|
+
) -> T_resp_json:
|
|
238
|
+
"""Update groups and default groups for Jira Server application roles.
|
|
239
|
+
|
|
240
|
+
Jira updates only the ``groups`` and ``defaultGroups`` properties. Use
|
|
241
|
+
the optional ETag returned by :meth:`get_all_application_roles` through
|
|
242
|
+
``if_match`` to avoid overwriting a newer role configuration.
|
|
243
|
+
|
|
244
|
+
Args:
|
|
245
|
+
application_roles: Roles to update, each including its ``key`` and
|
|
246
|
+
permitted mutable properties.
|
|
247
|
+
if_match: Optional ApplicationRole collection ETag for optimistic
|
|
248
|
+
concurrency control.
|
|
249
|
+
|
|
250
|
+
Returns:
|
|
251
|
+
Updated ApplicationRole collection.
|
|
252
|
+
"""
|
|
253
|
+
url = self.resource_url("applicationrole")
|
|
254
|
+
headers = dict(self.default_headers)
|
|
255
|
+
if if_match is not None:
|
|
256
|
+
headers["If-Match"] = if_match
|
|
257
|
+
return self.put(url, data=dumps(application_roles), headers=headers)
|
|
258
|
+
|
|
233
259
|
"""
|
|
234
260
|
Attachments
|
|
235
261
|
Reference: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.0/#api/2/attachment
|
|
@@ -766,6 +792,14 @@ class Jira(AtlassianRestAPI):
|
|
|
766
792
|
"""
|
|
767
793
|
|
|
768
794
|
def component(self, component_id: T_id) -> T_resp_json:
|
|
795
|
+
"""Perform the Jira component operation.
|
|
796
|
+
|
|
797
|
+
Args:
|
|
798
|
+
See the method signature for API request parameters.
|
|
799
|
+
|
|
800
|
+
Returns:
|
|
801
|
+
Decoded Jira REST response.
|
|
802
|
+
"""
|
|
769
803
|
base_url = self.resource_url("component")
|
|
770
804
|
return self.get(f"{base_url}/{component_id}")
|
|
771
805
|
|
|
@@ -780,22 +814,54 @@ class Jira(AtlassianRestAPI):
|
|
|
780
814
|
return self.get(url)
|
|
781
815
|
|
|
782
816
|
def create_component(self, component: dict) -> T_resp_json:
|
|
817
|
+
"""Perform the Jira create component operation.
|
|
818
|
+
|
|
819
|
+
Args:
|
|
820
|
+
See the method signature for API request parameters.
|
|
821
|
+
|
|
822
|
+
Returns:
|
|
823
|
+
Decoded Jira REST response.
|
|
824
|
+
"""
|
|
783
825
|
log.info('Creating component "%s"', component["name"])
|
|
784
826
|
base_url = self.resource_url("component")
|
|
785
827
|
url = f"{base_url}/"
|
|
786
828
|
return self.post(url, data=component)
|
|
787
829
|
|
|
788
830
|
def update_component(self, component: dict, component_id: T_id) -> T_resp_json:
|
|
831
|
+
"""Perform the Jira update component operation.
|
|
832
|
+
|
|
833
|
+
Args:
|
|
834
|
+
See the method signature for API request parameters.
|
|
835
|
+
|
|
836
|
+
Returns:
|
|
837
|
+
Decoded Jira REST response.
|
|
838
|
+
"""
|
|
789
839
|
base_url = self.resource_url("component")
|
|
790
840
|
url = f"{base_url}/{component_id}"
|
|
791
841
|
return self.put(url, data=component)
|
|
792
842
|
|
|
793
843
|
def delete_component(self, component_id: T_id) -> T_resp_json:
|
|
844
|
+
"""Perform the Jira delete component operation.
|
|
845
|
+
|
|
846
|
+
Args:
|
|
847
|
+
See the method signature for API request parameters.
|
|
848
|
+
|
|
849
|
+
Returns:
|
|
850
|
+
Decoded Jira REST response.
|
|
851
|
+
"""
|
|
794
852
|
log.info('Deleting component "%s"', component_id)
|
|
795
853
|
base_url = self.resource_url("component")
|
|
796
854
|
return self.delete(f"{base_url}/{component_id}")
|
|
797
855
|
|
|
798
856
|
def update_component_lead(self, component_id: T_id, lead: str) -> T_resp_json:
|
|
857
|
+
"""Perform the Jira update component lead operation.
|
|
858
|
+
|
|
859
|
+
Args:
|
|
860
|
+
See the method signature for API request parameters.
|
|
861
|
+
|
|
862
|
+
Returns:
|
|
863
|
+
Decoded Jira REST response.
|
|
864
|
+
"""
|
|
799
865
|
data = {"id": component_id, "leadUserName": lead}
|
|
800
866
|
base_url = self.resource_url("component")
|
|
801
867
|
return self.put(
|
|
@@ -916,7 +982,9 @@ class Jira(AtlassianRestAPI):
|
|
|
916
982
|
Returns a list of all fields, both System and Custom
|
|
917
983
|
:return: application/jsonContains a full representation of all visible fields in JSON.
|
|
918
984
|
"""
|
|
919
|
-
|
|
985
|
+
# Jira Cloud's v3 field resource is the current endpoint and includes
|
|
986
|
+
# custom fields visible to the caller. Keep Server/Data Center on v2.
|
|
987
|
+
url = self.resource_url("field", api_version=3 if self.cloud else None)
|
|
920
988
|
return self.get(url)
|
|
921
989
|
|
|
922
990
|
def create_custom_field(
|
|
@@ -1349,6 +1417,14 @@ class Jira(AtlassianRestAPI):
|
|
|
1349
1417
|
"""
|
|
1350
1418
|
|
|
1351
1419
|
def issue(self, key: T_id, fields: Union[str, dict] = "*all", expand: Optional[str] = None):
|
|
1420
|
+
"""Perform the Jira issue operation.
|
|
1421
|
+
|
|
1422
|
+
Args:
|
|
1423
|
+
See the method signature for API request parameters.
|
|
1424
|
+
|
|
1425
|
+
Returns:
|
|
1426
|
+
Decoded Jira REST response.
|
|
1427
|
+
"""
|
|
1352
1428
|
base_url = self.resource_url("issue")
|
|
1353
1429
|
url = f"{base_url}/{key}?fields={fields}"
|
|
1354
1430
|
params: dict = {}
|
|
@@ -1491,6 +1567,14 @@ class Jira(AtlassianRestAPI):
|
|
|
1491
1567
|
return self.get(url, params=params)
|
|
1492
1568
|
|
|
1493
1569
|
def issue_editmeta(self, key: str):
|
|
1570
|
+
"""Perform the Jira issue editmeta operation.
|
|
1571
|
+
|
|
1572
|
+
Args:
|
|
1573
|
+
See the method signature for API request parameters.
|
|
1574
|
+
|
|
1575
|
+
Returns:
|
|
1576
|
+
Decoded Jira REST response.
|
|
1577
|
+
"""
|
|
1494
1578
|
base_url = self.resource_url("issue")
|
|
1495
1579
|
url = f"{base_url}/{key}/editmeta"
|
|
1496
1580
|
return self.get(url)
|
|
@@ -1613,12 +1697,28 @@ class Jira(AtlassianRestAPI):
|
|
|
1613
1697
|
return self.put(url)
|
|
1614
1698
|
|
|
1615
1699
|
def issue_field_value(self, key: str, field: str):
|
|
1700
|
+
"""Perform the Jira issue field value operation.
|
|
1701
|
+
|
|
1702
|
+
Args:
|
|
1703
|
+
See the method signature for API request parameters.
|
|
1704
|
+
|
|
1705
|
+
Returns:
|
|
1706
|
+
Decoded Jira REST response.
|
|
1707
|
+
"""
|
|
1616
1708
|
base_url = self.resource_url("issue")
|
|
1617
1709
|
issue = self.get(f"{base_url}/{key}?fields={field}")
|
|
1618
1710
|
if issue:
|
|
1619
1711
|
return issue["fields"][field]
|
|
1620
1712
|
|
|
1621
1713
|
def issue_fields(self, key: str):
|
|
1714
|
+
"""Perform the Jira issue fields operation.
|
|
1715
|
+
|
|
1716
|
+
Args:
|
|
1717
|
+
See the method signature for API request parameters.
|
|
1718
|
+
|
|
1719
|
+
Returns:
|
|
1720
|
+
Decoded Jira REST response.
|
|
1721
|
+
"""
|
|
1622
1722
|
base_url = self.resource_url("issue")
|
|
1623
1723
|
issue = self.get(f"{base_url}/{key}")
|
|
1624
1724
|
if issue:
|
|
@@ -1752,6 +1852,14 @@ class Jira(AtlassianRestAPI):
|
|
|
1752
1852
|
return self.post(url, headers=self.no_check_headers, files=files)
|
|
1753
1853
|
|
|
1754
1854
|
def issue_exists(self, issue_key: str) -> Optional[bool]:
|
|
1855
|
+
"""Perform the Jira issue exists operation.
|
|
1856
|
+
|
|
1857
|
+
Args:
|
|
1858
|
+
See the method signature for API request parameters.
|
|
1859
|
+
|
|
1860
|
+
Returns:
|
|
1861
|
+
Decoded Jira REST response.
|
|
1862
|
+
"""
|
|
1755
1863
|
original_value = self.advanced_mode
|
|
1756
1864
|
self.advanced_mode = True
|
|
1757
1865
|
try:
|
|
@@ -1766,6 +1874,14 @@ class Jira(AtlassianRestAPI):
|
|
|
1766
1874
|
self.advanced_mode = original_value
|
|
1767
1875
|
|
|
1768
1876
|
def issue_deleted(self, issue_key: str) -> bool:
|
|
1877
|
+
"""Perform the Jira issue deleted operation.
|
|
1878
|
+
|
|
1879
|
+
Args:
|
|
1880
|
+
See the method signature for API request parameters.
|
|
1881
|
+
|
|
1882
|
+
Returns:
|
|
1883
|
+
Decoded Jira REST response.
|
|
1884
|
+
"""
|
|
1769
1885
|
exists = self.issue_exists(issue_key)
|
|
1770
1886
|
if exists:
|
|
1771
1887
|
log.info('Issue "%s" is not deleted', issue_key)
|
|
@@ -1971,11 +2087,27 @@ class Jira(AtlassianRestAPI):
|
|
|
1971
2087
|
|
|
1972
2088
|
# @todo refactor and merge with create_issue method
|
|
1973
2089
|
def issue_create(self, fields: dict):
|
|
2090
|
+
"""Perform the Jira issue create operation.
|
|
2091
|
+
|
|
2092
|
+
Args:
|
|
2093
|
+
See the method signature for API request parameters.
|
|
2094
|
+
|
|
2095
|
+
Returns:
|
|
2096
|
+
Decoded Jira REST response.
|
|
2097
|
+
"""
|
|
1974
2098
|
log.info('Creating issue "%s"', fields["summary"])
|
|
1975
2099
|
url = self.resource_url("issue")
|
|
1976
2100
|
return self.post(url, data={"fields": fields})
|
|
1977
2101
|
|
|
1978
2102
|
def issue_create_or_update(self, fields: dict):
|
|
2103
|
+
"""Perform the Jira issue create or update operation.
|
|
2104
|
+
|
|
2105
|
+
Args:
|
|
2106
|
+
See the method signature for API request parameters.
|
|
2107
|
+
|
|
2108
|
+
Returns:
|
|
2109
|
+
Decoded Jira REST response.
|
|
2110
|
+
"""
|
|
1979
2111
|
issue_key = fields.get("issuekey", None)
|
|
1980
2112
|
|
|
1981
2113
|
if not issue_key or not self.issue_exists(issue_key):
|
|
@@ -2199,6 +2331,14 @@ class Jira(AtlassianRestAPI):
|
|
|
2199
2331
|
return self.post(url, data=data)
|
|
2200
2332
|
|
|
2201
2333
|
def get_issue_remote_link_by_id(self, issue_key: str, link_id: T_id):
|
|
2334
|
+
"""Perform the Jira get issue remote link by id operation.
|
|
2335
|
+
|
|
2336
|
+
Args:
|
|
2337
|
+
See the method signature for API request parameters.
|
|
2338
|
+
|
|
2339
|
+
Returns:
|
|
2340
|
+
Decoded Jira REST response.
|
|
2341
|
+
"""
|
|
2202
2342
|
base_url = self.resource_url("issue")
|
|
2203
2343
|
url = f"{base_url}/{issue_key}/remotelink/{link_id}"
|
|
2204
2344
|
return self.get(url)
|
|
@@ -2242,6 +2382,14 @@ class Jira(AtlassianRestAPI):
|
|
|
2242
2382
|
return self.delete(url)
|
|
2243
2383
|
|
|
2244
2384
|
def get_issue_transitions(self, issue_key: str) -> List[dict]:
|
|
2385
|
+
"""Perform the Jira get issue transitions operation.
|
|
2386
|
+
|
|
2387
|
+
Args:
|
|
2388
|
+
See the method signature for API request parameters.
|
|
2389
|
+
|
|
2390
|
+
Returns:
|
|
2391
|
+
Decoded Jira REST response.
|
|
2392
|
+
"""
|
|
2245
2393
|
if self.advanced_mode:
|
|
2246
2394
|
resp = cast("Response", self.get_issue_transitions_full(issue_key))
|
|
2247
2395
|
d: Dict[str, list] = resp.json() or {}
|
|
@@ -2258,6 +2406,14 @@ class Jira(AtlassianRestAPI):
|
|
|
2258
2406
|
]
|
|
2259
2407
|
|
|
2260
2408
|
def issue_transition(self, issue_key: str, status: str) -> T_resp_json:
|
|
2409
|
+
"""Perform the Jira issue transition operation.
|
|
2410
|
+
|
|
2411
|
+
Args:
|
|
2412
|
+
See the method signature for API request parameters.
|
|
2413
|
+
|
|
2414
|
+
Returns:
|
|
2415
|
+
Decoded Jira REST response.
|
|
2416
|
+
"""
|
|
2261
2417
|
return self.set_issue_status(issue_key, status)
|
|
2262
2418
|
|
|
2263
2419
|
def set_issue_status(
|
|
@@ -2288,6 +2444,14 @@ class Jira(AtlassianRestAPI):
|
|
|
2288
2444
|
|
|
2289
2445
|
def get_issue_status_changelog(self, issue_id: T_id):
|
|
2290
2446
|
# Get the issue details with changelog
|
|
2447
|
+
"""Perform the Jira get issue status changelog operation.
|
|
2448
|
+
|
|
2449
|
+
Args:
|
|
2450
|
+
See the method signature for API request parameters.
|
|
2451
|
+
|
|
2452
|
+
Returns:
|
|
2453
|
+
Decoded Jira REST response.
|
|
2454
|
+
"""
|
|
2291
2455
|
response_get_issue = self.get_issue(issue_id, fields="id", expand="changelog")
|
|
2292
2456
|
status_change_history = []
|
|
2293
2457
|
for history in response_get_issue["changelog"]["histories"]:
|
|
@@ -2321,12 +2485,28 @@ class Jira(AtlassianRestAPI):
|
|
|
2321
2485
|
return self.post(url, data={"transition": {"name": transition_name}})
|
|
2322
2486
|
|
|
2323
2487
|
def get_issue_status(self, issue_key: str):
|
|
2488
|
+
"""Perform the Jira get issue status operation.
|
|
2489
|
+
|
|
2490
|
+
Args:
|
|
2491
|
+
See the method signature for API request parameters.
|
|
2492
|
+
|
|
2493
|
+
Returns:
|
|
2494
|
+
Decoded Jira REST response.
|
|
2495
|
+
"""
|
|
2324
2496
|
base_url = self.resource_url("issue")
|
|
2325
2497
|
url = f"{base_url}/{issue_key}?fields=status"
|
|
2326
2498
|
fields = [("fields",), ("status",), ("name",)]
|
|
2327
2499
|
return self._get_response_content(url, fields=fields) or {}
|
|
2328
2500
|
|
|
2329
2501
|
def get_issue_status_id(self, issue_key: str) -> str:
|
|
2502
|
+
"""Perform the Jira get issue status id operation.
|
|
2503
|
+
|
|
2504
|
+
Args:
|
|
2505
|
+
See the method signature for API request parameters.
|
|
2506
|
+
|
|
2507
|
+
Returns:
|
|
2508
|
+
Decoded Jira REST response.
|
|
2509
|
+
"""
|
|
2330
2510
|
base_url = self.resource_url("issue")
|
|
2331
2511
|
url = f"{base_url}/{issue_key}?fields=status"
|
|
2332
2512
|
fields = [("fields",), ("status",), ("id",)]
|
|
@@ -2367,16 +2547,40 @@ class Jira(AtlassianRestAPI):
|
|
|
2367
2547
|
return self.get(url)
|
|
2368
2548
|
|
|
2369
2549
|
def set_issue_property(self, issue_key: str, property_key: str, data: dict):
|
|
2550
|
+
"""Perform the Jira set issue property operation.
|
|
2551
|
+
|
|
2552
|
+
Args:
|
|
2553
|
+
See the method signature for API request parameters.
|
|
2554
|
+
|
|
2555
|
+
Returns:
|
|
2556
|
+
Decoded Jira REST response.
|
|
2557
|
+
"""
|
|
2370
2558
|
base_url = self.resource_url("issue")
|
|
2371
2559
|
url = f"{base_url}/{issue_key}/properties/{property_key}"
|
|
2372
2560
|
return self.put(url, data=data)
|
|
2373
2561
|
|
|
2374
2562
|
def get_issue_property(self, issue_key: str, property_key: str):
|
|
2563
|
+
"""Perform the Jira get issue property operation.
|
|
2564
|
+
|
|
2565
|
+
Args:
|
|
2566
|
+
See the method signature for API request parameters.
|
|
2567
|
+
|
|
2568
|
+
Returns:
|
|
2569
|
+
Decoded Jira REST response.
|
|
2570
|
+
"""
|
|
2375
2571
|
base_url = self.resource_url("issue")
|
|
2376
2572
|
url = f"{base_url}/{issue_key}/properties/{property_key}"
|
|
2377
2573
|
return self.get(url)
|
|
2378
2574
|
|
|
2379
2575
|
def delete_issue_property(self, issue_key: str, property_key: str):
|
|
2576
|
+
"""Perform the Jira delete issue property operation.
|
|
2577
|
+
|
|
2578
|
+
Args:
|
|
2579
|
+
See the method signature for API request parameters.
|
|
2580
|
+
|
|
2581
|
+
Returns:
|
|
2582
|
+
Decoded Jira REST response.
|
|
2583
|
+
"""
|
|
2380
2584
|
base_url = self.resource_url("issue")
|
|
2381
2585
|
url = f"{base_url}/{issue_key}/properties/{property_key}"
|
|
2382
2586
|
return self.delete(url)
|
|
@@ -2833,6 +3037,14 @@ class Jira(AtlassianRestAPI):
|
|
|
2833
3037
|
return self.get(url, params=params)
|
|
2834
3038
|
|
|
2835
3039
|
def get_all_projects(self, included_archived: Optional[bool] = None, expand: Optional[str] = None):
|
|
3040
|
+
"""Perform the Jira get all projects operation.
|
|
3041
|
+
|
|
3042
|
+
Args:
|
|
3043
|
+
See the method signature for API request parameters.
|
|
3044
|
+
|
|
3045
|
+
Returns:
|
|
3046
|
+
Decoded Jira REST response.
|
|
3047
|
+
"""
|
|
2836
3048
|
return self.projects(included_archived, expand)
|
|
2837
3049
|
|
|
2838
3050
|
def projects(self, included_archived: Optional[bool] = None, expand: Optional[str] = None):
|
|
@@ -3400,6 +3612,14 @@ class Jira(AtlassianRestAPI):
|
|
|
3400
3612
|
return custom_fields
|
|
3401
3613
|
|
|
3402
3614
|
def project_leaders(self):
|
|
3615
|
+
"""Perform the Jira project leaders operation.
|
|
3616
|
+
|
|
3617
|
+
Args:
|
|
3618
|
+
See the method signature for API request parameters.
|
|
3619
|
+
|
|
3620
|
+
Returns:
|
|
3621
|
+
Decoded Jira REST response.
|
|
3622
|
+
"""
|
|
3403
3623
|
for project in self.projects():
|
|
3404
3624
|
key = project["key"]
|
|
3405
3625
|
project_data = self.project(key)
|
|
@@ -3413,6 +3633,14 @@ class Jira(AtlassianRestAPI):
|
|
|
3413
3633
|
}
|
|
3414
3634
|
|
|
3415
3635
|
def get_project_issuekey_last(self, project: str):
|
|
3636
|
+
"""Perform the Jira get project issuekey last operation.
|
|
3637
|
+
|
|
3638
|
+
Args:
|
|
3639
|
+
See the method signature for API request parameters.
|
|
3640
|
+
|
|
3641
|
+
Returns:
|
|
3642
|
+
Decoded Jira REST response.
|
|
3643
|
+
"""
|
|
3416
3644
|
jql = f'project = "{project}" ORDER BY issuekey DESC'
|
|
3417
3645
|
response = self.jql(jql)
|
|
3418
3646
|
if self.advanced_mode:
|
|
@@ -3423,6 +3651,14 @@ class Jira(AtlassianRestAPI):
|
|
|
3423
3651
|
def get_project_issuekey_all(
|
|
3424
3652
|
self, project: str, start: int = 0, limit: Optional[int] = None, expand: Optional[str] = None
|
|
3425
3653
|
):
|
|
3654
|
+
"""Perform the Jira get project issuekey all operation.
|
|
3655
|
+
|
|
3656
|
+
Args:
|
|
3657
|
+
See the method signature for API request parameters.
|
|
3658
|
+
|
|
3659
|
+
Returns:
|
|
3660
|
+
Decoded Jira REST response.
|
|
3661
|
+
"""
|
|
3426
3662
|
jql = f'project = "{project}" ORDER BY issuekey ASC'
|
|
3427
3663
|
response = self.jql(jql, start=start, limit=limit, expand=expand)
|
|
3428
3664
|
if self.advanced_mode:
|
|
@@ -3430,6 +3666,14 @@ class Jira(AtlassianRestAPI):
|
|
|
3430
3666
|
return [issue["key"] for issue in cast("dict", response)["issues"]]
|
|
3431
3667
|
|
|
3432
3668
|
def get_project_issues_count(self, project: str):
|
|
3669
|
+
"""Perform the Jira get project issues count operation.
|
|
3670
|
+
|
|
3671
|
+
Args:
|
|
3672
|
+
See the method signature for API request parameters.
|
|
3673
|
+
|
|
3674
|
+
Returns:
|
|
3675
|
+
Decoded Jira REST response.
|
|
3676
|
+
"""
|
|
3433
3677
|
jql = f'project = "{project}" '
|
|
3434
3678
|
response = self.jql(jql, fields="*none")
|
|
3435
3679
|
if self.advanced_mode:
|
|
@@ -3485,11 +3729,27 @@ class Jira(AtlassianRestAPI):
|
|
|
3485
3729
|
return self.get(url)
|
|
3486
3730
|
|
|
3487
3731
|
def get_status_id_from_name(self, status_name: str):
|
|
3732
|
+
"""Perform the Jira get status id from name operation.
|
|
3733
|
+
|
|
3734
|
+
Args:
|
|
3735
|
+
See the method signature for API request parameters.
|
|
3736
|
+
|
|
3737
|
+
Returns:
|
|
3738
|
+
Decoded Jira REST response.
|
|
3739
|
+
"""
|
|
3488
3740
|
base_url = self.resource_url("status")
|
|
3489
3741
|
url = f"{base_url}/{status_name}"
|
|
3490
3742
|
return int(self._get_response_content(url, fields=[("id",)]))
|
|
3491
3743
|
|
|
3492
3744
|
def get_status_for_project(self, project_key: str) -> T_resp_json:
|
|
3745
|
+
"""Perform the Jira get status for project operation.
|
|
3746
|
+
|
|
3747
|
+
Args:
|
|
3748
|
+
See the method signature for API request parameters.
|
|
3749
|
+
|
|
3750
|
+
Returns:
|
|
3751
|
+
Decoded Jira REST response.
|
|
3752
|
+
"""
|
|
3493
3753
|
base_url = self.resource_url("project")
|
|
3494
3754
|
url = f"{base_url}/{project_key}/statuses"
|
|
3495
3755
|
return self.get(url)
|
|
@@ -3519,6 +3779,14 @@ class Jira(AtlassianRestAPI):
|
|
|
3519
3779
|
return self.get(url)
|
|
3520
3780
|
|
|
3521
3781
|
def get_transition_id_to_status_name(self, issue_key: str, status_name: str) -> Optional[int]:
|
|
3782
|
+
"""Perform the Jira get transition id to status name operation.
|
|
3783
|
+
|
|
3784
|
+
Args:
|
|
3785
|
+
See the method signature for API request parameters.
|
|
3786
|
+
|
|
3787
|
+
Returns:
|
|
3788
|
+
Decoded Jira REST response.
|
|
3789
|
+
"""
|
|
3522
3790
|
for transition in self.get_issue_transitions(issue_key):
|
|
3523
3791
|
if status_name.lower() == transition["to"].lower():
|
|
3524
3792
|
return int(transition["id"])
|
|
@@ -3848,7 +4116,10 @@ class Jira(AtlassianRestAPI):
|
|
|
3848
4116
|
params["jql"] = jql
|
|
3849
4117
|
if expand is not None:
|
|
3850
4118
|
params["expand"] = expand
|
|
3851
|
-
|
|
4119
|
+
# Enhanced JQL is only available at Jira Cloud REST API v3. The
|
|
4120
|
+
# legacy-compatible Jira client defaults to v2, so it must not use its
|
|
4121
|
+
# configured API version here.
|
|
4122
|
+
url = self.resource_url("search/jql", api_version=3)
|
|
3852
4123
|
return self.get(url, params=params)
|
|
3853
4124
|
|
|
3854
4125
|
def approximate_issue_count(
|
|
@@ -4006,7 +4277,7 @@ class Jira(AtlassianRestAPI):
|
|
|
4006
4277
|
if expand is not None:
|
|
4007
4278
|
params["expand"] = expand
|
|
4008
4279
|
|
|
4009
|
-
url = self.resource_url("search/jql")
|
|
4280
|
+
url = self.resource_url("search/jql", api_version=3)
|
|
4010
4281
|
results = []
|
|
4011
4282
|
next_page_token = None
|
|
4012
4283
|
|
|
@@ -4299,6 +4570,14 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
4299
4570
|
return self.delete(url)
|
|
4300
4571
|
|
|
4301
4572
|
def check_plugin_manager_status(self) -> Response:
|
|
4573
|
+
"""Perform the Jira check plugin manager status operation.
|
|
4574
|
+
|
|
4575
|
+
Args:
|
|
4576
|
+
See the method signature for API request parameters.
|
|
4577
|
+
|
|
4578
|
+
Returns:
|
|
4579
|
+
Decoded Jira REST response.
|
|
4580
|
+
"""
|
|
4302
4581
|
url = "rest/plugins/latest/safe-mode"
|
|
4303
4582
|
return self.request(method="GET", path=url, headers=self.safe_mode_headers)
|
|
4304
4583
|
|
|
@@ -4762,6 +5041,14 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
4762
5041
|
return response.json()
|
|
4763
5042
|
|
|
4764
5043
|
def reindex_project(self, project_key: str) -> T_resp_json:
|
|
5044
|
+
"""Perform the Jira reindex project operation.
|
|
5045
|
+
|
|
5046
|
+
Args:
|
|
5047
|
+
See the method signature for API request parameters.
|
|
5048
|
+
|
|
5049
|
+
Returns:
|
|
5050
|
+
Decoded Jira REST response.
|
|
5051
|
+
"""
|
|
4765
5052
|
return self.post(
|
|
4766
5053
|
"secure/admin/IndexProject.jspa",
|
|
4767
5054
|
data=f"confirmed=true&key={project_key}",
|
|
@@ -5235,6 +5522,14 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5235
5522
|
return self.get(url, params=params)
|
|
5236
5523
|
|
|
5237
5524
|
def tempo_timesheets_approval_status(self, period_start_date: str, user_name: str) -> T_resp_json:
|
|
5525
|
+
"""Perform the Jira tempo timesheets approval status operation.
|
|
5526
|
+
|
|
5527
|
+
Args:
|
|
5528
|
+
See the method signature for API request parameters.
|
|
5529
|
+
|
|
5530
|
+
Returns:
|
|
5531
|
+
Decoded Jira REST response.
|
|
5532
|
+
"""
|
|
5238
5533
|
url = "rest/tempo-timesheets/4/timesheet-approval/approval-statuses"
|
|
5239
5534
|
params: dict = {}
|
|
5240
5535
|
if user_name:
|
|
@@ -5262,6 +5557,14 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5262
5557
|
return self.get(url)
|
|
5263
5558
|
|
|
5264
5559
|
def tempo_teams_get_all_teams(self, expand: Optional[str] = None) -> T_resp_json:
|
|
5560
|
+
"""Perform the Jira tempo teams get all teams operation.
|
|
5561
|
+
|
|
5562
|
+
Args:
|
|
5563
|
+
See the method signature for API request parameters.
|
|
5564
|
+
|
|
5565
|
+
Returns:
|
|
5566
|
+
Decoded Jira REST response.
|
|
5567
|
+
"""
|
|
5265
5568
|
url = "rest/tempo-teams/2/team"
|
|
5266
5569
|
params: dict = {}
|
|
5267
5570
|
if expand:
|
|
@@ -5343,12 +5646,36 @@ api-group-workflows/#api-rest-api-2-workflow-search-get)
|
|
|
5343
5646
|
return self.put(url, data=data)
|
|
5344
5647
|
|
|
5345
5648
|
def tempo_timesheets_get_period_configuration(self) -> T_resp_json:
|
|
5649
|
+
"""Perform the Jira tempo timesheets get period configuration operation.
|
|
5650
|
+
|
|
5651
|
+
Args:
|
|
5652
|
+
See the method signature for API request parameters.
|
|
5653
|
+
|
|
5654
|
+
Returns:
|
|
5655
|
+
Decoded Jira REST response.
|
|
5656
|
+
"""
|
|
5346
5657
|
return self.get("rest/tempo-timesheets/3/period-configuration")
|
|
5347
5658
|
|
|
5348
5659
|
def tempo_timesheets_get_private_configuration(self) -> T_resp_json:
|
|
5660
|
+
"""Perform the Jira tempo timesheets get private configuration operation.
|
|
5661
|
+
|
|
5662
|
+
Args:
|
|
5663
|
+
See the method signature for API request parameters.
|
|
5664
|
+
|
|
5665
|
+
Returns:
|
|
5666
|
+
Decoded Jira REST response.
|
|
5667
|
+
"""
|
|
5349
5668
|
return self.get("rest/tempo-timesheets/3/private/config")
|
|
5350
5669
|
|
|
5351
5670
|
def tempo_teams_get_memberships_for_member(self, username: str) -> T_resp_json:
|
|
5671
|
+
"""Perform the Jira tempo teams get memberships for member operation.
|
|
5672
|
+
|
|
5673
|
+
Args:
|
|
5674
|
+
See the method signature for API request parameters.
|
|
5675
|
+
|
|
5676
|
+
Returns:
|
|
5677
|
+
Decoded Jira REST response.
|
|
5678
|
+
"""
|
|
5352
5679
|
return self.get(f"rest/tempo-teams/2/user/{username}/memberships")
|
|
5353
5680
|
|
|
5354
5681
|
#######################################################################
|