-
Notifications
You must be signed in to change notification settings - Fork 0
/
extractor.py
108 lines (90 loc) · 2.57 KB
/
extractor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
from jira import JIRA
from metrics.status import time_by_status
from metrics.sprint import sprint_statistics
from exporters.csv_exporter import CSVExport
from exporters.gsheets_exporter import GSheetsExport
def search_issues(project, months_ago):
jira = JIRA(
server='',
basic_auth=('', ''),
)
query = f'project={project} AND created <= -{months_ago}m'
return jira.search_issues(query, expand='changelog', maxResults=False)
def extract(
project,
upstream_statuses,
downstream_statuses,
months_ago=1,
sprint_field=None,
google_sheets_url=None
):
issues = search_issues(project=project, months_ago=months_ago)
time_metric = time_by_status(
issues,
upstream_statuses=upstream_statuses,
downstream_statuses=downstream_statuses
)
metrics = [time_metric,]
if sprint_field:
sprint_metric = sprint_statistics(issues)
metrics.append(sprint_metric)
# exporter = CSVExport()
# exporter.export(issues, metric)
sheets = GSheetsExport(
url=google_sheets_url,
upstream_statuses=upstream_statuses,
downstream_statuses=downstream_statuses,
sprint_field=sprint_field
)
sheets.export(issues, metrics)
def extract_produto_busca():
extract(
project='VDPLAT',
upstream_statuses=[
'BACKLOG',
'REFINING',
'PRIORIZADOS',
'DETALHAMENTO DA HIPÓTESE',
'A INICIAR',
],
downstream_statuses=[
'AGUARDANDO DESENVOLVIMENTO',
'IN PROGRESS',
'CODE REVIEW',
'EM HOMOLOGAÇÃO',
],
google_sheets_url=''
)
def extract_im():
extract(
project='IM',
upstream_statuses=[
'POOL DE IDEIAS',
'A INICIAR',
'DETALHAMENTO DA HIPÓTESE',
'CRIAÇÃO',
'REFINING',
'AGUARDANDO DESENVOLVIMENTO',
],
downstream_statuses=[
'PRIORIZADOS',
'AGUARDANDO DESENVOLVIMENTO',
'DISCOVERY CONCLUÍDO',
'IN PROGRESS',
'AGUARDANDO TESTES',
'EM DESENVOLVIMENTO',
'EM HOMOLOGAÇÃO',
'AGUARDANDO HOMOLOGAÇÃO',
'TESTES',
'VALIDAÇÃO 1',
'VALIDAÇÃO 2',
'CODE REVIEW',
'AJUSTES V1',
'PRONTO P/ CODE REVIEW',
'ACEITO',
'PRONTO P/ DEPLOY EM PROD',
],
sprint_field='customfield_10020',
google_sheets_url=''
)
extract_im()