get_tickets_comments {zdeskR}R Documentation

Get tickets comments/replies

Description

This function takes your email ID, authentication token, sub-domain, and specific ticket ID to fetch all comments/replies to this wanted ticket.

Usage

get_tickets_comments(
  email_id,
  token,
  subdomain,
  ticket_id,
  add_cols = NULL,
  metadata = FALSE
)

Arguments

email_id

Zendesk Email ID (username).

token

Zendesk API token.

subdomain

Your organization's Zendesk sub-domain.

ticket_id

The ticket ID number. A numeric value.

add_cols

Vector of column names to select in addition to the default.

metadata

Logical value (TRUE or FALSE). If TRUE, metadata columns will be included. This is set to FALSE by default.

Details

By default only these columns are returned: "id", "type", "author_id", "body", "created_at", "have_attachments". You can add other variables using the 'add_cols' parameter. The variables that can be inserted are described in the Zendesk API documentation: https://developer.zendesk.com/api-reference/ ticketing/tickets/ticket_comments/.

The meaning of the default columns included are described in the previous link, except "have-attachments" which is a boolean field that will be "Yes" if the comment has an attachment or "No" if it does not. The attachment itself cannot be returned.

If you request the 'metadata' sensitive data (location, lat, long, IP address, etc.) will be included. This data should be handled with care and only stored and used per your organization's policies and applicable privacy regulations.

Value

a Data Frame containing all comments/replies for a single ticket.

References

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/

Examples

## Not run: 
## Extracting comments with default columns and without sensitive data
comments_ticket_id <- get_tickets_comments(email_id, token, subdomain,
ticket_id, add_cols = NULL, metadata = FALSE)

## Extracting comments with additional columns and sensitive data
comments_ticket_id <- get_tickets_comments(email_id, token, subdomain,
ticket_id, add_cols = c("html_body", "attachments"), metadata = TRUE)

## End(Not run)

[Package zdeskR version 0.4.1 Index]