JIRA SERVER JIRA CLOUD

In some cases, you want to know where the comment came from, specifically, when you have several Projects in sync. 

The Exalate app allows showing the remote Issue Key when synching comments. 

You can configure the Data filter to send the comment with the issue key to the destination side.  Or configure Create/Change processor to display remote issue key with the incoming sync comment request.

Source side

Use the code below to send the issue key.


Data Filter

 

 replica.key = issue.key


Destination side 

Use it when you want to display the remote issue key with a comment on your side for incoming sync requests.


Create/Change Processor


Display the remote issue key in the comment:

 issue.comments  = commentHelper.mergeComments(
           issue, replica, { 
               comment ->
                 comment.body = replica.key+", "+comment.body
   }
)

Display the remote issue key as a simple link in the comment. 

The code below shows how you can construct the link itself using Groovy scripting.

issue.comments  = commentHelper.mergeComments(
    issue, replica,{
        comment -> 
            comment.body =  "[" + replica.key 
                + "|https://INSTANCE_URL/browse/"+replica.key+"]"
                + ", "+comment.body
    }
)

 

Check how to format comments from the remote issue for more details.

See Also