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.
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.