brynq-sdk-jira 3.0.0__tar.gz → 3.0.2__tar.gz
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.
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/PKG-INFO +1 -1
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira/jira.py +46 -28
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira/tempo.py +1 -1
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira.egg-info/PKG-INFO +1 -1
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/setup.py +2 -2
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira/__init__.py +0 -0
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira.egg-info/SOURCES.txt +0 -0
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira.egg-info/dependency_links.txt +0 -0
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira.egg-info/not-zip-safe +0 -0
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira.egg-info/requires.txt +0 -0
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/brynq_sdk_jira.egg-info/top_level.txt +0 -0
- {brynq_sdk_jira-3.0.0 → brynq_sdk_jira-3.0.2}/setup.cfg +0 -0
|
@@ -26,42 +26,60 @@ class Jira(BrynQ):
|
|
|
26
26
|
:param expand_fields: an optional list of fields to expand
|
|
27
27
|
:return: dataframe with issues
|
|
28
28
|
"""
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
if jira_filter_id is not None:
|
|
30
|
+
raise ValueError("Jira filter id is no longer supported, use jql_filter instead")
|
|
31
|
+
|
|
32
|
+
# Use new JQL search endpoint
|
|
33
|
+
url = f"{self.base_url}rest/api/3/search/jql"
|
|
34
|
+
|
|
35
|
+
all_issues = []
|
|
36
|
+
next_page_token = None
|
|
37
|
+
|
|
38
|
+
while True:
|
|
39
|
+
payload = {
|
|
40
|
+
"maxResults": 100,
|
|
41
|
+
"fields": ["summary", "issuetype", "timetracking", "timespent", "description", "assignee", "project"]
|
|
38
42
|
}
|
|
43
|
+
|
|
44
|
+
if jql_filter:
|
|
45
|
+
payload["jql"] = jql_filter
|
|
46
|
+
|
|
47
|
+
if get_extra_fields:
|
|
48
|
+
payload["fields"].extend(get_extra_fields)
|
|
49
|
+
|
|
50
|
+
if expand_fields:
|
|
51
|
+
# Convert list to comma-delimited string
|
|
52
|
+
payload["expand"] = ",".join(expand_fields)
|
|
53
|
+
|
|
54
|
+
if next_page_token:
|
|
55
|
+
payload["nextPageToken"] = next_page_token
|
|
56
|
+
|
|
39
57
|
if self.debug:
|
|
40
|
-
print(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
else:
|
|
50
|
-
url = f"{self.base_url}rest/api/3/search"
|
|
51
|
-
response = requests.post(url=url, headers=self.headers, data=json.dumps(query), timeout=self.timeout)
|
|
58
|
+
print(f"Payload: {payload}")
|
|
59
|
+
|
|
60
|
+
response = requests.post(
|
|
61
|
+
url=url,
|
|
62
|
+
headers=self.headers,
|
|
63
|
+
data=json.dumps(payload),
|
|
64
|
+
timeout=self.timeout
|
|
65
|
+
)
|
|
66
|
+
|
|
52
67
|
if response.status_code == 200:
|
|
53
68
|
response_json = response.json()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
69
|
+
all_issues.extend(response_json.get("issues", []))
|
|
70
|
+
|
|
71
|
+
# Check for next page
|
|
72
|
+
if "nextPageToken" in response_json:
|
|
73
|
+
next_page_token = response_json["nextPageToken"]
|
|
74
|
+
else:
|
|
75
|
+
break
|
|
57
76
|
else:
|
|
58
77
|
raise ConnectionError(f"Error getting issues from Jira with message: {response.status_code, response.text}")
|
|
59
78
|
|
|
60
79
|
if self.debug:
|
|
61
|
-
print(f"Received {len(
|
|
62
|
-
|
|
63
|
-
df = pd.json_normalize(total_response)
|
|
80
|
+
print(f"Received {len(all_issues)} issues from Jira")
|
|
64
81
|
|
|
82
|
+
df = pd.json_normalize(all_issues)
|
|
65
83
|
return df
|
|
66
84
|
|
|
67
85
|
def get_projects(self) -> pd.DataFrame:
|
|
@@ -143,4 +161,4 @@ class Jira(BrynQ):
|
|
|
143
161
|
print(f"Received {len(all_users)} jira users from Jira")
|
|
144
162
|
|
|
145
163
|
df = pd.json_normalize(all_users)
|
|
146
|
-
return df
|
|
164
|
+
return df
|
|
@@ -9,7 +9,7 @@ class Tempo(BrynQ):
|
|
|
9
9
|
def __init__(self, system_type: Optional[Literal['source', 'target']] = None, debug=False):
|
|
10
10
|
super().__init__()
|
|
11
11
|
self.debug = debug
|
|
12
|
-
credentials = self.interfaces.credentials.get(system="
|
|
12
|
+
credentials = self.interfaces.credentials.get(system="jira", system_type=system_type)
|
|
13
13
|
credentials = credentials.get('data')
|
|
14
14
|
self.headers = {
|
|
15
15
|
"Authorization": f"Bearer {credentials['api_token']}",
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='brynq_sdk_jira',
|
|
5
|
-
version='3.0.
|
|
5
|
+
version='3.0.2',
|
|
6
6
|
description='JIRA wrapper from BrynQ',
|
|
7
7
|
long_description='JIRA wrapper from BrynQ',
|
|
8
8
|
author='BrynQ',
|
|
@@ -15,4 +15,4 @@ setup(
|
|
|
15
15
|
'requests>=2,<=3'
|
|
16
16
|
],
|
|
17
17
|
zip_safe=False,
|
|
18
|
-
)
|
|
18
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|