Created
May 22, 2016 18:02
-
-
Save jechlin/e2986c732852789b317dcfaf97efb37a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package examples | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.issue.link.IssueLinkManager | |
log.debug("is subtask: ${issue.isSubTask()}") | |
if (issue.isSubTask()) { | |
log.debug("issue id: ${issue.id}") | |
log.debug("parent: ${issue.parentObject}") | |
def issueManager = ComponentAccessor.getIssueManager() | |
def refreshedIssue = issueManager.getIssueObject(issue.parentObject.id) | |
log.debug("sibs: ${refreshedIssue.subTaskObjects*.key}") | |
def issueLinkManager = ComponentAccessor.getComponent(IssueLinkManager) | |
issueLinkManager.createIssueLink(issue.id, issueManager.getIssueObject("SRTESTPRJ-14").id, 10000L, 0, ComponentAccessor.jiraAuthenticationContext.loggedInUser) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment