Hi,
Jira supports links from issues to other issues and also links to external Web pages. For example:
The Issue.getIssueLinks() method appears to only retrieve links to other issues and not the link to the external Web page. E.g., the following code:
System.out.format("Start dumping links for issue %s%n", issue.getKey());
for (IssueLink il : issue.getIssueLinks()) {
System.out.format("- Issue link: %s%n", il);
}
System.out.format("End dumping links for issue %s%n", issue.getKey());
Causes the following to be printed:
Start dumping links for issue OPP-14
- Issue link: IssueLink{targetIssueKey=OPP-7, targetIssueUri=https://deljirauat/rest/api/2/issue/54357, issueLinkType=IssueLinkType{name=Relates, description=relates to, direction=OUTBOUND}}
End dumping links for issue OPP-14
Using the Java REST Java Client (I am using version 5.1.6):
Thanks,
James
For anyone using JRJC - it actually supports remote link endpoint.
RemoteIssueLinkManager is made for this purpose.
For getting all remote links for the issue:
List<RemoteIssueLink> remoteIssueLinks = remoteIssueLinkManager.getRemoteIssueLinksForIssue(issueId);
For creating new remote issue link:
remoteIssueLinkManager.createRemoteIssueLink(remoteIssueLink, applicationUser);
Hi James,
I understand that you're using the JRJC and trying to get back these weblinks in the results. The reason this is not working is because the REST endpoint you're calling, GET /rest/api/2/issueLink/{linkId}, only is expected to return other Jira issues on this same Jira site.
In this case, in order to get back these weblinks you actually want to be calling a different REST API endpoint, specifically GET /rest/api/2/issue/{issueIdOrKey}/remotelink. These remote links can be to specific URLs, which typically issue links technically don't do. You can also create a remote issue link by using the endpoint POST /rest/api/2/issue/{issueIdOrKey}/remotelink.
I hope this helps.
Cheers,
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andy,
My apologies for not responding sooner - I have been away on annual leave.
As far as I can tell, the JRJC does not support the remotelink endpoint. For this reason, I ended up rolling my own basic Java client (as I only needed to access two endpoints, this did not require too much effort).
Thanks,
James
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.