1
0
-1

Hi,


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


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!


  1. Berry Kersten

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

CommentAdd your comment...

1 answer

  1.  
    2
    1
    0

    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(", ")
    1. Berry Kersten

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

    2. Berry Kersten

      Hi Juan Grases one more additional question.


      Currently the link is displayed as:

      https://support.test.uniface.info/browse/UFC-25669(is 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(", ")



    3. Berry Kersten

      Fixed it! There was a space missing...

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

    CommentAdd your comment...