Hello everybody,
I'm new to ScriptRunner and try to make a script function "Clones an issue and links".
I would like to make a simple condition, that will only process the Clone if there is no linked issue with the Inward Link "Kunden-Ticket übernommen nach".
I found @JamieA 's Post in this topic and tried to adapt it, but it doesn't work. Everytime a new Clone is created.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
def issueLinkManager2 = ComponentAccessor.getComponent(IssueLinkManager)
! issueLinkManager2.getInwardLinks(issue.getId()).any {
it.issueLinkType.name == "Kunden-Ticket übernommen nach"
}
I did make it work.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
def IssueLinkManager = ComponentAccessor.getIssueLinkManager()
def Linkvorhanden = false
issueLinkManager.getInwardLinks(issue.getId()).any {
it.issueLinkType.name == "Kunden-Ticket übernommen nach"
Linkvorhanden = true
}
Linkvorhanden == false
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.