# How to retrieve the ticket participants on zendesk

**URL:** <https://community.exalate.com/t/how-to-retrieve-the-ticket-participants-on-zendesk/4709>\
**Category:** General Questions\
**Tags:** cloud-zendesk, migrated\_question, usecase-general\
**Created:** [November 4, 2024, 7:18am UTC](https://community.exalate.com/t/how-to-retrieve-the-ticket-participants-on-zendesk/4709 "2024-11-04T07:18:14Z")\
**Posts on this page:** 2\
**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:18am UTC](https://community.exalate.com/t/how-to-retrieve-the-ticket-participants-on-zendesk/4709/1 "2024-11-04T07:18:14Z")

</div>

_Originally asked by Francis Martens (Exalate) on 17 May 2021 [(original question)](https://oldcommunity.exalate.com/questions/25072453)_

* * *

The challenge is a follows

Whenever a ticket is created on behalf of a certain user, that certain user is added as a ‘cc’ user.  
This customer would like to set this user as the reporter of the twin

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

* * *

---

<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:18am UTC](https://community.exalate.com/t/how-to-retrieve-the-ticket-participants-on-zendesk/4709/2 "2024-11-04T07:18:15Z")

</div>

_Answer by Francis Martens (Exalate) on 17 May 2021_

Retrieving the cc user is not supported (atm) on Exalate for Zendesk. Still it is possible to use the httpClient to retrieve the necessary information.  
Zendesk is providing a REST endpoint to extract that information from the environment - check  
[https://developer.zendesk.com/rest\_api/docs/support/tickets#list-email-ccs-for-a-ticket](https://developer.zendesk.com/rest_api/docs/support/tickets#list-email-ccs-for-a-ticket)

How can this be used to extract the required information from the ticket

Check following code

**Outgoing sync - Zendesk side**

```auto
def response = httpClient.get("/api/v2/tickets/${ticket.id}/email_ccs")

if (response.count > 0) {
    def firstUser = response.users.first()
    replica.customKeys.ccName = firstUser.name
    replica.customKeys.ccEmail = firstUser.email
}

```

- On line 1 - httpClient is used to retrieve the email\_ccs from the ticket. The ticket is identified with the ticket.id
- On line 3 - test if the response contains a number of emails.
- On line 4 - Note there can be multiple emails, this example is returning the first user returned by the Zendesk API
- On line 6 and 7 - extract the information contained in the firstUser object (name and email)

On the other side (assume Jira) following logic can be applied to fill in a text field with a wiki renderer

**Incoming sync - Jira**

```auto
// fill custom field 'cc' in case the ccName and email are provided
if (replica.customKeys.ccName > "") {
   issue.customFields.cc.value = "[${replica.customKeys.ccName}|mailto:${replica.customKeys.ccEmail}]"
}

```

* * *
