Hello All,
I am trying to create an Remote Link for an issue in my current instance with an issue in the remote instance. The code part is clear to me. Here's the snippet. I am trying the script in the script console for the time being.
def remoteIssueLinkService = ComponentAccessor.getComponent(RemoteIssueLinkService);
def builder = new RemoteIssueLinkBuilder();
builder.issueId(issue.id);
def appLinkId = finalLink.getId(); // application link id
def issueId = "51295"
builder.globalId("appLinkId="+appLinkId.get()+"&issueId="+issueId)
builder.url("https://jira.instance.com/browse/CHANG-3315")
builder.title("Issue in remote JIRA test")
builder.relationship("relates to")
builder.applicationName("Remote JIRA")
builder.applicationType("com.atlassian.jira")
builder.resolved(false)
def remoteIssueLink = builder.build();
log.info(remoteIssueLink.getGlobalId())
def validationResult = remoteIssueLinkService.validateCreate(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(),remoteIssueLink);
log.info(validationResult.isValid())
if(validationResult.isValid()) {
def result = remoteIssueLinkService.create(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), validationResult)
log.info "result is" + result;
} else {
log.error validationResult.errorCollection.errorMessages
I see the error in the logs
Remote link aggregation cache clearing webhook failed - exception.
There is an open ticket as well - https://jira.atlassian.com/browse/JRASERVER-46608
When I visit the issue view screen of the current instance then I see the remote issue link being created but with a message "Failed to load" and a rotation icon Gif next to it. But the title and the URL which I set in the remoteIssueBuilder points to the correct remote issue in the partially created failed link.
Thus, I wanted to know is it not working because of the above open issue or am I missing some data in the remote issue link builder? or can it be something else. As I have done something similar before (JIRA 6.x) and it worked like a charm but not anymore. I am using JIRA Server 7.4.3
Thanks,
tarun