1
1
# coding=utf-8
2
- from typing_extensions import Literal
3
2
import logging
4
3
import os
5
4
import re
6
- from typing import TYPE_CHECKING , Any , BinaryIO , cast , Optional , Union , Dict , List
5
+ from typing import Any , BinaryIO , Dict , List , Optional , Union , cast
7
6
from warnings import warn
8
7
9
8
from deprecated import deprecated
10
9
from requests import HTTPError , Response
10
+ from typing_extensions import Literal
11
11
12
12
from .errors import ApiNotFoundError , ApiPermissionError
13
13
from .rest_client import AtlassianRestAPI
14
-
15
- if TYPE_CHECKING :
16
- from .typehints import T_id , T_resp_json
14
+ from .typehints import T_id , T_resp_json
17
15
18
16
log = logging .getLogger (__name__ )
19
17
@@ -234,7 +232,7 @@ def get_application_role(self, role_key: str) -> T_resp_json:
234
232
def get_attachments_ids_from_issue (self , issue : T_id ) -> List [Dict [str , str ]]:
235
233
"""
236
234
Get attachments IDs from jira issue
237
- :param jira issue key: str
235
+ :param issue: str jira issue key
238
236
:return: list of integers attachment IDs
239
237
"""
240
238
issue_id = self .get_issue (issue )["fields" ]["attachment" ]
@@ -512,7 +510,7 @@ def issue_get_comments(self, issue_id: T_id) -> T_resp_json:
512
510
def issues_get_comments_by_id (self , * args : int ) -> T_resp_json :
513
511
"""
514
512
Get Comments on Multiple Issues
515
- :param * args: int Issue ID's
513
+ :param args: int Issue ID's
516
514
:raises: requests.exceptions.HTTPError
517
515
:return:
518
516
"""
@@ -1431,7 +1429,7 @@ def get_issue_labels(self, issue_key: str) -> T_resp_json:
1431
1429
1432
1430
def update_issue (self , issue_key : T_id , update : Union [str , dict ]) -> T_resp_json :
1433
1431
"""
1434
- :param issue : the issue to update
1432
+ :param issue_key : the issue to update
1435
1433
:param update: the update to make
1436
1434
:return: True if successful, False if not
1437
1435
"""
@@ -1440,7 +1438,7 @@ def update_issue(self, issue_key: T_id, update: Union[str, dict]) -> T_resp_json
1440
1438
1441
1439
def label_issue (self , issue_key : T_id , labels : list ):
1442
1440
"""
1443
- :param issue : the issue to update
1441
+ :param issue_key : the issue to update
1444
1442
:param labels: the labels to add
1445
1443
:return: True if successful, False if not
1446
1444
"""
@@ -1485,7 +1483,7 @@ def issue_exists(self, issue_key: str) -> Optional[bool]:
1485
1483
original_value = self .advanced_mode
1486
1484
self .advanced_mode = True
1487
1485
try :
1488
- resp = self .issue (issue_key , fields = "*none" )
1486
+ resp = cast ( Response , self .issue (issue_key , fields = "*none" ) )
1489
1487
if resp .status_code == 404 :
1490
1488
log .info ('Issue "%s" does not exists' , issue_key )
1491
1489
return False
0 commit comments