Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

How to retrieve the ticket participants on zendesk

 
1
0
-1

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


    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      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


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


      Check following code


      Outgoing sync - Zendesk side
      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
      // 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}]"
      }
        CommentAdd your comment...