Display multiple issue links

Originally asked by Berry Kersten on 09 October 2020 (original question)


Hi,

Currently I’m syncing an issue link by the following scripts

Outgoing

replica.customKeys.issueLinks = issue.issueLinks.collect{ baseUrl + im.getIssueObject(it.otherIssueId as Long).key}

Incoming

issue.customFields."ServiceDesk ID".value = replica.customKeys.issueLinks.join(",")

This works like a charm (in case of 1 issue link), however I’m not sure how to change this for the use case where I have multiple and different issue links.

Now the result on the remote site is like this:

Custom field:

https://someurl1/browse/ISSUEKEY-1,https://someurl1/browse/ISSUEKEY-2

I would to have something like this

Custom field:

https://someurl1/browse/ISSUEKEY-1 (is caused by)”, https://someurl1/browse/ISSUEKEY-2 (relates to)

Ideas anyone? Thanks!


Comments:

Berry Kersten commented on 16 November 2020

Hi Juan Grasesdo you have an idea how to realize this? Thanks.

Answer by Juan Grases on 17 November 2020

Hi Berry, could you try:

Outgoing:

replica.customKeys.issueLinks = issue.issueLinks
.collect{
 baseUrl + im.getIssueObject(it.otherIssueId as Long).key + "("+it.linkName+")"
}


The incoming is good as it is. Maybe you can leave a space between comas:

issue.customFields."ServiceDesk ID".value = replica.customKeys.issueLinks.join(", ")

Comments:

Berry Kersten commented on 18 November 2020

Thanks a lot. This works and is exactly what I needed!

Berry Kersten commented on 17 December 2020

Hi Juan Grases one more additional question.

Currently the link is displayed as:

[https://support.test.uniface.info/browse/UFC\-25669(is](Log in - Uniface Service Desk(is “Follow link”) caused by)

When opening that link it’s also displayed as

Is there a trick/way to exclude the “(is” in the URL? Because in some browsers this results in not finding the issue when clicking on the link.

Current rules:

outgoing

replica.customKeys.issueLinks = issue.issueLinks
.collect{
baseUrl + im.getIssueObject(it.otherIssueId as Long).key + "("+it.linkName+")"
}

incoming

issue.customFields."ServiceDesk ID".value = replica.customKeys.issueLinks.join(", ")
Berry Kersten commented on 04 January 2021

Fixed it! There was a space missing…

baseUrl + im.getIssueObject(it.otherIssueId as Long).key + " ("+it.linkName+")" 
  

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.