# Exalate Comment Condition

**URL:** <https://community.exalate.com/t/exalate-comment-condition/5492>\
**Category:** General Questions\
**Tags:** exalate, jira, zendesk-jira, migrated\_question\
**Created:** [November 4, 2024, 8:07am UTC](https://community.exalate.com/t/exalate-comment-condition/5492 "2024-11-04T08:07:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:07am UTC](https://community.exalate.com/t/exalate-comment-condition/5492/1 "2024-11-04T08:07:59Z")

</div>

_Originally asked by George Smith on 16 May 2023 [(original question)](https://oldcommunity.exalate.com/questions/58501974)_

* * *

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

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:08am UTC](https://community.exalate.com/t/exalate-comment-condition/5492/2 "2024-11-04T08:08:00Z")

</div>

_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**

```auto
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**

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

```

Here is a short video demonstrating the scripts in action:

Hope it helps!

Thanks

Majid

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:08am UTC](https://community.exalate.com/t/exalate-comment-condition/5492/3 "2024-11-04T08:08:01Z")

</div>

_Answer by Syed Majid Hassan on 22 May 2023_

HI Kazim,

Can you change the Jira Incoming line to:

```auto
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

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:08am UTC](https://community.exalate.com/t/exalate-comment-condition/5492/4 "2024-11-04T08:08:02Z")

</div>

_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?

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 8:08am UTC](https://community.exalate.com/t/exalate-comment-condition/5492/5 "2024-11-06T08:08:24Z")

</div>

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