-
Notifications
You must be signed in to change notification settings - Fork 0
/
Milestone.py
66 lines (55 loc) · 1.69 KB
/
Milestone.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
class Milestone:
def __init__(self, target_start, target_end, name, label, team):
self._target_start = target_start
self._target_end = target_end
self._name = name
self._label = label
self.team = team
# target_start getter and setter
@property
def target_start(self):
return self._target_start
@target_start.setter
def target_start(self, value):
self._target_start = value
# target_end getter and setter
@property
def target_end(self):
return self._target_end
@target_end.setter
def target_end(self, value):
self._target_end = value
# name getter and setter
@property
def name(self):
return self._name
@name.setter
def name(self, value):
self._name = value
# label getter and setter
@property
def label(self):
return self._label
@label.setter
def label(self, value):
self._label = value
# team getter and setter
@property
def team(self):
return self._team
@team.setter
def team(self, value):
self._team = value
def map_issues_to_milestones(issues):
milestones = []
for issue in issues:
target_start = issue.fields.customfield_10027
target_end = issue.fields.customfield_10028
name = issue.fields.summary
label = issue.fields.labels
if (issue.fields.customfield_10001 is not None):
team = issue.fields.customfield_10001.name
milestone = Milestone(target_start, target_end, name, label, team)
if ((milestone is not None) & (milestone.target_start is not None)):
milestones.append(milestone)
return milestones