I'm writing script (behaviour) which doing next : If current issue (for example A-1 has linked issue with key CRSUB and issueType Story. Then customField "Def on prod" become avaliable for certain group in project. How i can do it? I have some dificults in writing this script.
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.link.IssueLink;
IssueManager im = ComponentAccessor.getIssueManager();
MutableIssue issue = im.getIssueObject("CR-177")
def links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
def output = ""
for( l in links) {
output = output + l.getDestinationObject() + "<br/>"
if (output.contains("CRSUB") ){
log.warn("test")
}
}
return output
// How to get current issue and issueType of linked issue? Im stuck
The iterative object here should be an issue in its own right, so l.getKey() would be a starting point. You can probably see how to get the rest of the issue information.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.