from com atlassian jira component import ComponentAccessor userUtil Co

 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
from com.atlassian.jira.component import ComponentAccessor
userUtil = ComponentAccessor.getUserUtil()
watcherUtil = ComponentAccessor.getWatcherManager()
components = issue.getComponentObjects()
watcherLordOfTheRings = [u'Властелин Колец Онлайн', u'Властелин колец', u'Властелин колец (LotRO)']
watcherCrossFire = [u'Cross Fire', u'CrossFire', u'Crossfire']
a = (
('Perfect World', ('a.saskovets@mail.msk', 'a.grishin@mail.msk')),
('Strife', ('s.zimin@mail.msk')),
(u'Бумз! (DDT, DanDanTank)', ('v.utochkin@mail.msk')),
(u'Бумз!', ('v.utochkin@mail.msk')),
('Armored Warfare', ('v.utochkin@mail.msk', 'm.kozhanov@mail.msk')),
(watcherLordOfTheRings, ('alexey.larionov@mail.msk')),
)
if components:
for component in components:
for i in a:
if component.getName() in i[0]:
e = i[1]
if isinstance(e, str): e = (e,)
for w in e:
watcherUtil.startWatching(userUtil.getUser(w), issue)