# Duplicate author on comment

**URL:** <https://community.exalate.com/t/duplicate-author-on-comment/4727>\
**Category:** General Questions\
**Tags:** exalate, zendesk, jira, migrated\_question\
**Created:** [November 4, 2024, 7:19am UTC](https://community.exalate.com/t/duplicate-author-on-comment/4727 "2024-11-04T07:19:38Z")\
**Posts on this page:** 3\
**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, 7:19am UTC](https://community.exalate.com/t/duplicate-author-on-comment/4727/1 "2024-11-04T07:19:38Z")

</div>

_Originally asked by Christos Katsivas on 04 June 2021 [(original question)](https://oldcommunity.exalate.com/questions/30048259)_

* * *

Hi team,

I have an integration between Jira and Zendesk. I would like to cut the comment when it has more than 65535 characters. I have created a script and its works fine but the comment author appears 2 times. How i can fix this?  
You can find attached the script and the comment.

 ![](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/5eaf06046c9a7d900ede81666010a88c3003d07c.png)

```auto
//Comments
issue.comments = commentHelper.mergeComments(
issue,
replica,
{ comment ->

if (comment.internal) {
comment.body = "Internal " + "comment from Zendesk: \n" + "[" + comment.author.displayName +
"| mailto:" + comment.author.email + "]" +
" commented: \n" + comment.body
}
else {
comment.body = "Public "+"comment from Zendesk: \n" +
"[" + comment.author.displayName +
"| mailto:" + comment.author.email + "]" +
" commented: \n" +comment.body
}

def maxCommentLength = 65535
def template = "[

{0}

|mailto:

{1}

]" +
" commented: \n" +
"'

{quote'}\n" +
"{2};\n" +
"'{quote'}

\n"
def renderedWithoutBody = java.text.MessageFormat.format(
template,
comment.author.displayName,
comment.author.email,
""
)
def allowedLength = maxCommentLength

renderedWithoutBody.length()

comment.body = java.text.MessageFormat.format(
template,
comment.author.displayName,
comment.author.email,
comment.body.take(allowedLength)
)
comment;
}
)

```

Thank you.

* * *

#### Comments:

> **Francis Martens (Exalate) commented on 04 June 2021**
>
> > The code is hard to read - can you reformat it?

> **Christos Katsivas commented on 07 June 2021**
>
> > Hi Francis,
> 
> Yes I confirm. I found the problem and its works fine.
> 
> Thank you.

---

<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, 7:19am UTC](https://community.exalate.com/t/duplicate-author-on-comment/4727/2 "2024-11-04T07:19:39Z")

</div>

_Answer by Francis Martens (Exalate) on 05 June 2021_

Looking at the image, the comment was ping-ponged.

Comment C on source issue ‘A’ was synced to issue’B’, getting reformatted to C’  
Then that comment (C’) was synced back to issue A, being reformatted to C’’

Can you confirm?

* * *

---

<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, 7:20am UTC](https://community.exalate.com/t/duplicate-author-on-comment/4727/3 "2024-11-06T07:20:29Z")

</div>

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