Good Afternoon!
Let me outline what it is I'm trying to get to.
Background Information: We have Epics, Features, and Enablers in Project B. Before any of these issueTypes can be progressed beyond a "New" status, they have to be a "Child of" issueLink to something (they're supposed to be a "Child of" an Initiative issueType, but people will put anything there to move their issue).
Ask: I want it to be that an Epic/Feature/Enabler cannot progress beyond New UNTIL it's a "Child of" an Initiative issueType (in Project A).
I am not the best coder, just being honest. But I cannot, for the life of me, figure out how to do this via a ScriptRunner validation/script or Behaviour.
Can someone help! Please and thank you!
Here is a start. You would install this as a Script Condition using ScriptRunner.
import com.atlassian.jira.component.ComponentAccessor;
final String LINK_TYPE = "DUPLICATE";
final String ISSUE_TYPE = "Initiative";
def linkManager = ComponentAccessor.getIssueLinkManager();
def links = ComponentAccessor.getIssueLinkManager()
.getLinkCollectionOverrideSecurity(issue)
.getOutwardIssues(LINK_TYPE)
.find{
it.getIssueType().getName() == ISSUE_TYPE
};
You need to update the Link Type and the Issue Type to match what you want. This particular code does not check that the outward linked issue is in a specific project. You can add that in the find closure if you want.
I hope that this helps.
I'm going to try this. For now, I've created two additional customFields (issuePicker with a JQL). But, this has the potential to be much cleaner.
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.