smartpush 1.0.1.6__py3-none-any.whl → 1.0.1.7__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.
- smartpush/autotest/__init__.py +0 -0
- smartpush/get_jira_info/__init__.py +0 -0
- smartpush/get_jira_info/get_jira_info.py +64 -0
- {smartpush-1.0.1.6.dist-info → smartpush-1.0.1.7.dist-info}/METADATA +1 -1
- smartpush-1.0.1.7.dist-info/RECORD +8 -0
- smartpush-1.0.1.6.dist-info/RECORD +0 -5
- {smartpush-1.0.1.6.dist-info → smartpush-1.0.1.7.dist-info}/WHEEL +0 -0
- {smartpush-1.0.1.6.dist-info → smartpush-1.0.1.7.dist-info}/top_level.txt +0 -0
File without changes
|
File without changes
|
@@ -0,0 +1,64 @@
|
|
1
|
+
from jira import JIRA
|
2
|
+
|
3
|
+
|
4
|
+
def get_custom_fields(jira):
|
5
|
+
all_fields = jira.fields()
|
6
|
+
# print(all_fields)
|
7
|
+
custom_fields = {}
|
8
|
+
for field in all_fields:
|
9
|
+
try:
|
10
|
+
# print(field)
|
11
|
+
if field.get('custom'):
|
12
|
+
if field['scope']['project']['id'] == '10559':
|
13
|
+
custom_fields[field['id']] = field['name']
|
14
|
+
except:
|
15
|
+
continue
|
16
|
+
print(custom_fields)
|
17
|
+
return custom_fields
|
18
|
+
|
19
|
+
|
20
|
+
if __name__ == '__main__':
|
21
|
+
api_key = "ATATT3xFfGF0YeIApQYdm4c671OUkhg5ggVISNgIb0D1Iqpd2dwwunzff98Pc5VQjb74ZN997uXvvxi6LpmNGJx1kW1BLh5AaudMj5RuWTe6uozsGqGpx_QkySeU2HF-JB37kkza9PREOpOSbiDFZxrI0eqYPV9Fe-bJP0RM16V_GSyDPib0wmw=FE3DE2B1"
|
22
|
+
|
23
|
+
# Jira 服务器的 URL
|
24
|
+
jira_url = "https://shopline.atlassian.net/"
|
25
|
+
# Jira API 密钥
|
26
|
+
jira_api_key = api_key
|
27
|
+
# Jira 用户名
|
28
|
+
jira_user = "lu.lu@shopline.com"
|
29
|
+
|
30
|
+
# 连接到 Jira 服务器
|
31
|
+
jira = JIRA(server=jira_url, basic_auth=(jira_user, jira_api_key))
|
32
|
+
|
33
|
+
# 获取一个项目的信息
|
34
|
+
project_key = 10559 # 替换为你想要获取的项目的 key
|
35
|
+
project = jira.project(project_key)
|
36
|
+
print(f"Project: {project.key} - {project.name}")
|
37
|
+
|
38
|
+
all_fields = jira.fields()
|
39
|
+
# print(all_fields)
|
40
|
+
|
41
|
+
# 获取项目的问题
|
42
|
+
issues = jira.search_issues(f"project={project_key}")
|
43
|
+
issue = jira.issue(issues[0])
|
44
|
+
# print("Issue Key:", issue.key)
|
45
|
+
# print("Summary:", issue.fields.summary)
|
46
|
+
# # print("Description:", issue.fields.description)
|
47
|
+
# print("Assignee:", issue.fields.assignee.displayName if issue.fields.assignee else "Unassigned")
|
48
|
+
# print("Reporter:", issue.fields.reporter.displayName)
|
49
|
+
# print("Status:", issue.fields.status.name)
|
50
|
+
# print("Priority:", issue.fields.priority.name)
|
51
|
+
# print("Created:", issue.fields.created)
|
52
|
+
# print("Updated:", issue.fields.updated)
|
53
|
+
# print("Due Date:", issue.fields.duedate)
|
54
|
+
# print("Labels:", issue.fields.labels)
|
55
|
+
# print("Components:", [component.name for component in issue.fields.components])
|
56
|
+
# print(issue.fields.__dict__.items())
|
57
|
+
custom_fields = get_custom_fields(jira)
|
58
|
+
for field_name, field_value in issue.fields.__dict__.items():
|
59
|
+
try:
|
60
|
+
# if field_name.startswith("customfield_"):
|
61
|
+
# continue
|
62
|
+
print(f"Custom Field ID: {field_name}, NAME:{custom_fields[field_name]}, Value: {field_value}")
|
63
|
+
except:
|
64
|
+
continue
|
@@ -0,0 +1,8 @@
|
|
1
|
+
smartpush/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
smartpush/autotest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
smartpush/get_jira_info/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
smartpush/get_jira_info/get_jira_info.py,sha256=zXp5OB9fVY5e0RbYcqlcq3ClqwLBAEvAVPZ1A_PrdMg,2416
|
5
|
+
smartpush-1.0.1.7.dist-info/METADATA,sha256=3qqYT-ndwwiuo1nQk1wWI5zC_3QQbglOBNPROR2PuRw,147
|
6
|
+
smartpush-1.0.1.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
7
|
+
smartpush-1.0.1.7.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
8
|
+
smartpush-1.0.1.7.dist-info/RECORD,,
|
@@ -1,5 +0,0 @@
|
|
1
|
-
smartpush/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
smartpush-1.0.1.6.dist-info/METADATA,sha256=eUIoAZxwh1Mx6FshYHqRK2rueudKqSX2-h3eGmlHjLk,147
|
3
|
-
smartpush-1.0.1.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
smartpush-1.0.1.6.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
5
|
-
smartpush-1.0.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|