I am updating a transition in the workflow with a clone as part of the transition. It will clone the issue from the "Customer" project to the "Development Team" project when the customer issue is approved.
However, I would like to add a condition that would allow this to happen only if the issue has not already been cloned. In the set up there is a section for Condition but I have not been able to get it to work if there is already a cloned issue off the issue and it just clones a new issue.
Here is the condition that I have tried to get working:
!issueLinkManager.getInwardLinks(issue.getId())*.issueLinkType.name.contains('is cloned by')
Like I said it just ignores it and creates a new clone anyway.
Here is the screen that I am talking about:
Hi Alex,
Could you try the following?
import com.atlassian.jira.component.ComponentAccessor
// Services & Managers
def issueLinkManager = ComponentAccessor.issueLinkManager
//--------------------------------------------------------------
// You must change the following variables as your needs
//--------------------------------------------------------------
def linkDesc = "is cloned by"
//--------------------------------------------------------------
// Look for all linked issues
def anyInwardLinkedIssues = issueLinkManager.getInwardLinks(issue.id).any{issueLink -> issueLink.issueLinkType.inward.equalsIgnoreCase(linkDesc)}
def anyOutwardLinkedIssues = issueLinkManager.getOutwardLinks(issue.id).any{issueLink -> issueLink.issueLinkType.outward.equalsIgnoreCase(linkDesc)}
return !(anyInwardLinkedIssues || anyOutwardLinkedIssues)
Regards
OMG... that so worked... Thanks so much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Congrats!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.