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
Hi Tarun,
Could you clarify if the issue link is being created here or not? From what I have read I believe that it is, however the Jira logs still record this exception. The bug ticket you linked to appears to be related to this problem, however the original report of this problem in that bug ticket did indicate that the issue link does appear to work. Just want to better understand the scope of this problem.
I can't say for sure if your specific code has any differentiating affect on this. It does seem that other users have encountered this problem between Jira and other application linked programs, like Confluence, Bamboo, etc. When you create issue links like this to another Jira, or from another application to Jira, you're utilizing an existing application link with that Jira site.
I would be interested to learn more about that specific application link to better understand the problem. For example, the URL in use, the authentication method employed by that application link, and the versions of both applications in question. Each application could be utilizing different versions of the applink libraries, which might also play a role in why this error might be getting generated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another thing to try: Without utilizing your code above, try to create an issue link in the Jira web UI between these two issues on different Jira sites. I am curious to see if this process behaves any differently in regards to the actions/results/log exceptions that appear in your environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andy HeinzerIn my case this is the main part of the code. It´s between Jira Software 7.9 and Jira Service Desk 3.12.2
linkBuilder.issueId(issue.id)
linkBuilder.url("http://<base url>/" + Issue_Remoto_Value)
linkBuilder.title(Issue_Remoto_Value)
linkBuilder.relationship("ticket asociado")
linkBuilder.applicationType("APPLICATION_TYPE_JIRA")
linkBuilder.applicationName("Jira Service Desk")
linkBuilder.statusName(issue.getStatus().getName())
linkBuilder.statusIconUrl("http://<base url>/" + issue.getIssueType().iconUrl)
linkBuilder.globalId("appId="+appLinkId.get()+"&issueId="+issue.id)
In the logs I see:
Remote link aggregation cache clearing webhook failed - exception.
As for the link view in Jira, it´s OK, except that I can´t see the status of the remote issue. When I use Link from Jira, it does.
I am using Applications Link with OAuth (with impersonation) for both local and remote.
I would like to get the same performance that if I were using Jira´s Link for linking the issues.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Andy Heinzer
Thanks for your response. Since I was trying this in last year feb thus I might not remember all details of the process but I clearly remember the following things
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tarun Sapra, Did you find a solution? I am runnning into the same error. I am with JIRA 7.9.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Adolfo Casari following globalId format fixed failed to load issue for me:
def globalId = 'appId=RemoteJirasAppLinkID&issueId=RemoteIssueId'
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.
@Adolfo Casari Hi,
for RemoteJirasAppLinkID i used Application Link ID which you can find in Application Link configuration (like you can find customfield ID) RemoteIssueID was taken from sessionDetails.issues.id
def quer='issuekey=someJQL'
def request = applicationLinkRequestFactory.createRequest(GET, "/rest/api/2/search?jql=${quer}")
def handler = new ApplicationLinkResponseHandler() {
@Override
def credentialsRequired(Response response) throws ResponseException {
return null
}
@Override
def handle(Response response) throws ResponseException {
assert response.statusCode == 200
new JsonSlurper().parseText(response.getResponseBodyAsString())
}
}
def sessionDetails = request.execute(handler)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.