Anonymous     Text only     05 Apr 2012    
 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 import ComponentManager
from com.atlassian.jira.util import JiraUtils
from com.atlassian.jira.workflow import WorkflowTransitionUtilImpl
from com.atlassian.jira.util import ImportUtils
authenticationContext = ComponentManager.getInstance().getJiraAuthenticationContext()
workflowTransitionUtil = JiraUtils.loadComponent(WorkflowTransitionUtilImpl)
indexManager = ComponentManager.getInstance().getIndexManager()
issueManager = ComponentManager.getInstance().getIssueManager()
linkManager = ComponentManager.getInstance().getIssueLinkManager()
issueLink = linkManager.getInwardLinks(issue.getId())
issueLinks = linkManager.getInwardLinks(issue.getId())
for issueLink in issueLinks:
linkedissue = issueLink.getSourceObject()
if linkedissue:
workflowTransitionUtil.setIssue(linkedissue)
workflowTransitionUtil.setAction(781)
workflowTransitionUtil.setUsername(authenticationContext.getUser().getName())
workflowTransitionUtil.validate()
workflowTransitionUtil.progress()
ImportUtils.setIndexIssues(True)
indexManager.reIndex(linkedissue)
ImportUtils.setIndexIssues(False)