from com atlassian jira import ComponentManager from com atlassian jir

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from com.atlassian.jira import ComponentManager
from com.atlassian.jira.security.roles import ProjectRoleManager
auth_Context = ComponentManager.getInstance().getJiraAuthenticationContext()
projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager)
current_user = auth_Context.getLoggedInUser()
project = issue.getProjectObject()
roleDevelopers = projectRoleManager.getProjectRole(u'Managers')
projectRoles = projectRoleManager.getProjectRoles(current_user, project)
if projectRoleManager.isUserInProjectRole(current_user, roleDevelopers, project):
result = True
else:
result = False
description = u'На данный момент невозможно создать задачу данного типа'