from com atlassian jira import ComponentManager issueGv issue getGener

 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
from com.atlassian.jira import ComponentManager
issueGv = issue.getGenericValue()
watcherManager = ComponentManager.getInstance().getWatcherManager()
components = issue.getComponents()
customFieldManager = ComponentManager.getInstance().getCustomFieldManager()
gameprojfield = customFieldManager.getCustomFieldObjectByName(u'Игровой проект')
gameproj = issue.getCustomFieldValue(gameprojfield)
if str(gameproj) != "None":
#Число элементов
kakaunt = len(gameproj)
for i in range(int(kakaunt)):
if gameproj.get(i) == "Perfect World" :
componentManager = ComponentManager.getInstance()
userUtil= componentManager.getUserUtil()
userw = userUtil.getUser('a.saskovets@mail.msk')
watcherManager.startWatching(userw, issueGv)
if gameproj.get(i) == "Battle of the Immortals" :
componentManager = ComponentManager.getInstance()
userUtil= componentManager.getUserUtil()
userw = userUtil.getUser('i.portnoy@mail.msk')
watcherManager.startWatching(userw, issueGv)
userw = userUtil.getUser('a.sakhi@mail.msk')
watcherManager.startWatching(userw, issueGv)
if gameproj.get(i) == u"Пиратия":
componentManager = ComponentManager.getInstance()
userUtil= componentManager.getUserUtil()
userw = userUtil.getUser('i.portnoy@mail.msk')
watcherManager.startWatching(userw, issueGv)
#.getValue()