Exalate Comment Condition

Originally asked by George Smith on 16 May 2023 (original question)


Only the comments beginning with jira# should sync over to Jira from ZD.


Answer by Syed Majid Hassan on 17 May 2023

HI George Smith,

I have worked on this case and ensured that the following is happening:

  • Only internal comments from ZD side are considered for sync
  • Only internal comments that contain the word #DEV# are sent to Jira.

In order to configure this, we need to ensure that we filter out the comments in the ZD outgoing script:

Zendesk outgoing

replica.comments  = issue.comments.findAll { 
    comment ->
    if (comment.internal)
        comment.body =~ /#DEV#(.*)/
}

You can definitely play around with the regular expression here to modify the selection.

On the Jira side, you can continue to use the standard line for comments handling in the Incoming script:

Jira Incoming

issue.comments     = commentHelper.mergeComments(issue, replica)

Here is a short video demonstrating the scripts in action:

Hope it helps!

Thanks

Majid


Answer by Syed Majid Hassan on 22 May 2023

HI Kazim,

Can you change the Jira Incoming line to:

issue.comments     = commentHelper.mergeComments(issue, replica, {
    comment ->
    comment.body = comment.body.substring(5)
    comment
})

and see if that resolves the issue.

Thanks

Majid


Comments:

Syed Majid Hassan commented on 05 June 2023

Hi Kazim Yildirim ,

Are you all set on this one please?

Thanks

Majid

Answer by Kazim Yildirim on 22 May 2023

This works fine for me.

Thanks!

PS: One topic to optimize…what to do, not to display the hashtag #DEV# on JIRA side?


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