smartpush 1.0.2.0__py3-none-any.whl → 1.0.2.1__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/__init__.py CHANGED
@@ -1,2 +1 @@
1
- from autotest import *
2
- from jira import *
1
+ from autotest import *
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smartpush
3
- Version: 1.0.2.0
3
+ Version: 1.0.2.1
4
4
  Summary: 用于smartpush自动化测试工具包
5
5
  Home-page: UNKNOWN
6
6
  Author: 卢泽彬、邵宇飞、周彦龙
@@ -0,0 +1,6 @@
1
+ smartpush/__init__.py,sha256=8YLMr3_2USRVnJ8rmIvjwXhICGMt9wF9sWRH1Wxfnj4,22
2
+ smartpush/get_jira_info.py,sha256=zXp5OB9fVY5e0RbYcqlcq3ClqwLBAEvAVPZ1A_PrdMg,2416
3
+ smartpush-1.0.2.1.dist-info/METADATA,sha256=B3Hg_pkM1uPhS0NLoZn_iNQPOOEGQqIXjtQoBE4eHEA,210
4
+ smartpush-1.0.2.1.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
5
+ smartpush-1.0.2.1.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
6
+ smartpush-1.0.2.1.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- smartpush/__init__.py,sha256=5EFAQA-WIuJEZJss0pdR8O2_4vbZlIL7L_hDX5uupAo,41
2
- smartpush-1.0.2.0.dist-info/METADATA,sha256=a3cwXFkJC6yGxrbfdHel6jSx2_xxshruah0Nkc9_EC0,210
3
- smartpush-1.0.2.0.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
4
- smartpush-1.0.2.0.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
5
- smartpush-1.0.2.0.dist-info/RECORD,,