I am trying to delete the remote links using groovy script and I encountered below method for the same
removeRemoteIssueLink(Long remoteIssueLinkId, ApplicationUser user)
So for this what is the remoteIssuelinkId and how do we fetch it in the script.
Can someone please help me with this
You can retrieve all issue's remote issue links using getRemoteIssueLinksForIssue(Issue issue) method and find the link you wanted. After that, you can get the link's ID. Something like this
def remoteLink = remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue).find {it.getTitle() == 'YourLinkTitle'}
def remoteIssueLinkId = remoteLink.getId()
I am trying as below and it is not working
def remoteLink = remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue)
def remoteIssueLinkId = remoteLink.getId()
It is throwing error cannot find getId() method . I am not sure on what to pass in Title. So removed that find method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue) is a List of links. Firstly you should find one you needed link and then you can get the link's ID
The Title is the name of the link you see on an issue. For example, you can get all your issue's link titles
remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue)*.getTitle()
Or if you want to delete all possible remote links try this
remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue).each {
remoteIssueLinkManager.removeRemoteIssueLink(it.getId(), user)
}
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.
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.