Hi all -
I have a rather large script which does a lot of stuff and I get it to work bit by bit -
this last part is supposed to create a link to a cloned issue - which is does but in the wrong direction
I want to achieve that it creates an outwards pointing link
From the Parent to the Cloned issue
so in the PARENT ISSUE I would like to see:
"is cloned by" - to my definiton an "outward pointing link"
so I tried this
for (IssueLink link in linkManager.getOutwardLinks(issue.id)) {
and the CLONED ISSUE should have
"clones" - to my definition an "inward pointing link"
so I tried this
for (IssueLink link in linkManager.getInwardLinks(issue.id)) {
But I cannot get it to do this -
It always places a
"clones" in the PARENT ISSUE
and a
"is cloned" into the CLONED ISSUE
[ START OF SCRIPT SNIPPET ]
def sequence = 0
for (IssueLink link in linkManager.getOutwardLinks(issue.id)) {
if ("Cloners" == link.issueLinkType.name)
{
sequence++;
}
}
Collection<IssueLinkType> issueLinkTypes = linkTypeManager.getIssueLinkTypes()
String linkID=null;
for (IssueLinkType issueLinkType : issueLinkTypes)
{
String name=issueLinkType.getName();
if(name.equals("Cloners"))
{
linkID=issueLinkType.getId();
break;
}
}
Long issueID = new Long(issue.id).longValue();
Long newissueID = new Long(newissue.id).longValue();
Long TheLinkID = new Long(linkID).longValue();
Long TheSequence = new Long(sequence).longValue();
linkManager.createIssueLink (issueID, newissueID,TheLinkID, TheSequence, currentUser)
[ END OF SCRIPT SNIPPET ]
Any hint be very much appreciated
thanks a lot
Werner
Hi
have you tried reversing the issue ids in call
linkManager.createIssueLink (newissueID, issueID, TheLinkID, TheSequence, currentUser)
Hi Tom - your suggestion indeed turned it upside down - the right way - thanks a lot
- I did not think it would make a difference, but never tried - I should have tried.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great news
could you mark as answered for others to find
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tom, I thought I did press the answer button - but it did not work - I have to use a different browser to get this functionality. It is the same for the REPLY button - it does not show in Internet Explorer - only in Firefox.
cheers
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.