I have groovy script on post function which links issue with another issue in different jira instance
def linkIssues(String remoteIssue){
def linkBuilder = new RemoteIssueLinkBuilder()
linkBuilder.issueId(issue.id)
linkBuilder.url("https://myJira.net/browse/${remoteIssue}")
linkBuilder.title("${remoteIssue}")
linkBuilder.relationship("depends on)")
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def remoteIssueLinkService = ComponentAccessor.getComponent(RemoteIssueLinkService)
def validationResult = remoteIssueLinkService.validateCreate(user, linkBuilder.build())
try{
if (validationResult.isValid()) {
remoteIssueLinkService.create(user, validationResult)
log.info "Remote link created"
}else {
log.error "Remote link NOT created ${validationResult.errorCollection.errorMessages}"
}
} catch(Exception ex){
log.warn(ex.getMessage())
}
}
It works and issues are linked but I don't see status of linked issue in my Jira. But when I link issues manually status of linked issue is available.
Hi Aas,
There is ScriptRunner Connect app that would be perfect for that.
Hi @John Funk , thanks for reply, but I hope there is some java api to solve my problem with scriptrunner
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.