Reference

Endpoint Update Ticket (Single)


Name

put_ticket

Description

Update single ticket. Use bulk operation if you pfrefer to update multiple tickets. If you like to set additional_tags or remove_tags then use BULK Table (Tickets) [API reference]

Related Tables

Tickets (Row by Row)

Parameters

Parameter Required Options
Name: id

Label: Ticket ID to Update

YES

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
id DT_I8 bigint
recipient DT_WSTR nvarchar(255) 255
subject DT_WSTR nvarchar(1000) 1000
status DT_WSTR nvarchar(28) 28
type DT_WSTR nvarchar(255) 255
priority DT_WSTR nvarchar(24) 24
description DT_NTEXT nvarchar(MAX)
external_id DT_WSTR nvarchar(255) 255
created_at DT_DBTIMESTAMP datetime
updated_at DT_DBTIMESTAMP datetime
raw_subject DT_WSTR nvarchar(1000) 1000
url DT_WSTR nvarchar(500) 500
comment_count DT_I8 bigint
requester_id DT_I8 bigint
submitter_id DT_I8 bigint
assignee_id DT_I8 bigint
organization_id DT_I8 bigint
group_id DT_I8 bigint
collaborator_ids DT_WSTR nvarchar(1000) 1000
collaborator_ids_1 DT_WSTR nvarchar(20) 20
collaborator_ids_2 DT_WSTR nvarchar(20) 20
collaborator_ids_3 DT_WSTR nvarchar(20) 20
follower_ids DT_WSTR nvarchar(1000) 1000
follower_ids_1 DT_WSTR nvarchar(20) 20
follower_ids_2 DT_WSTR nvarchar(20) 20
follower_ids_3 DT_WSTR nvarchar(20) 20
email_cc_ids DT_WSTR nvarchar(1000) 1000
email_cc_ids_1 DT_WSTR nvarchar(20) 20
email_cc_ids_2 DT_WSTR nvarchar(20) 20
email_cc_ids_3 DT_WSTR nvarchar(20) 20
forum_topic_id DT_WSTR nvarchar(255) 255
problem_id DT_WSTR nvarchar(255) 255
has_incidents DT_BOOL bit
is_public DT_BOOL bit
due_at DT_DBTIMESTAMP datetime
tags DT_WSTR nvarchar(1000) 1000
tags_1 DT_WSTR nvarchar(50) 50
tags_2 DT_WSTR nvarchar(50) 50
tags_3 DT_WSTR nvarchar(50) 50
tags_4 DT_WSTR nvarchar(50) 50
tags_5 DT_WSTR nvarchar(50) 50
custom_fields DT_WSTR nvarchar(1000) 1000
custom_fields_1_id DT_WSTR nvarchar(20) 20
custom_fields_1_value DT_WSTR nvarchar(1000) 1000
custom_fields_2_id DT_WSTR nvarchar(20) 20
custom_fields_2_value DT_WSTR nvarchar(1000) 1000
custom_fields_3_id DT_WSTR nvarchar(20) 20
custom_fields_3_value DT_WSTR nvarchar(1000) 1000
custom_fields_4_id DT_WSTR nvarchar(20) 20
custom_fields_4_value DT_WSTR nvarchar(1000) 1000
custom_fields_5_id DT_WSTR nvarchar(20) 20
custom_fields_5_value DT_WSTR nvarchar(1000) 1000
via_followup_source_id DT_I8 bigint
satisfaction_rating_id DT_I8 bigint
satisfaction_rating_score DT_WSTR nvarchar(20) 20
satisfaction_rating_comment DT_WSTR nvarchar(1000) 1000
sharing_agreement_ids DT_WSTR nvarchar(255) 255
fields DT_WSTR nvarchar(1000) 1000
followup_ids DT_WSTR nvarchar(1000) 1000
brand_id DT_I8 bigint
allow_channelback DT_BOOL bit
allow_attachments DT_BOOL bit
via_channel DT_WSTR nvarchar(100) 100
via_source_rel DT_WSTR nvarchar(255) 255
via_source_from_address DT_WSTR nvarchar(500) 500
via_source_from_name DT_WSTR nvarchar(500) 500
via_source_to_name DT_WSTR nvarchar(500) 500
via_source_to_address DT_WSTR nvarchar(500) 500
via_source_from_ticket_id DT_I8 bigint
via_source_from_subject DT_WSTR nvarchar(1000) 1000
via_source_from_channel DT_WSTR nvarchar(50) 50
custom_field_[$parent.id$] DT_WSTR nvarchar(4000) 4000
If the column you are looking for is missing, consider customizing Zendesk Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
id DT_I8 bigint
allow_channelback DT_BOOL bit
brand_id DT_I8 bigint
followup_ids DT_WSTR nvarchar(1000) 1000
fields DT_WSTR nvarchar(1000) 1000
sharing_agreement_ids DT_WSTR nvarchar(255) 255
due_at DT_DBTIMESTAMP datetime
is_public DT_BOOL bit
problem_id DT_WSTR nvarchar(255) 255
forum_topic_id DT_WSTR nvarchar(255) 255
email_cc_ids DT_WSTR nvarchar(1000) 1000
follower_ids DT_WSTR nvarchar(1000) 1000
collaborator_ids DT_WSTR nvarchar(1000) 1000
group_id DT_I8 bigint
organization_id DT_I8 bigint
allow_attachments DT_BOOL bit
assignee_id DT_I8 bigint
requester_id DT_I8 bigint
requester_email DT_WSTR nvarchar(255) 255
requester_name DT_WSTR nvarchar(255) 255
external_id DT_WSTR nvarchar(255) 255
custom_fields DT_WSTR nvarchar(1000) 1000
tags DT_WSTR nvarchar(1000) 1000
comment_author_id DT_I8 bigint
comment_public DT_BOOL bit
comment_body_html DT_NTEXT nvarchar(MAX)
comment_body DT_NTEXT nvarchar(MAX)
priority DT_WSTR nvarchar(24) 24
type DT_WSTR nvarchar(255) 255
status DT_WSTR nvarchar(28) 28
recipient DT_WSTR nvarchar(255) 255
submitter_id DT_I8 bigint
subject DT_WSTR nvarchar(1012) 1012
Required columns that you need to supply are bolded.

Examples

SSIS

Use Zendesk Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Destination

This Endpoint belongs to the Tickets (Row by Row) table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to update ticket:

API Destination - Zendesk
Zendesk Connector can be used to integrate Zendesk REST API in your App / BI Tools. You can read/write data about Tickets, Activity, Users, Organizations and more.
Zendesk
Tickets (Row by Row)
Update
Required Parameters
Ticket ID to Update Fill-in the parameter...
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Update ticket by Id

Update Tickets 
SET subject='Test ticket subject'
  , tags='["tag1","tag2"]' 
  --, additional_tags ='["tag1","tag2"]' --tags you like to remove
  --, remove tags='["tag1","tag2"]'
  , status='pending' --new, solved, closed
  --below json can be obtained using select custom_fields from tickets where id=1234
  , custom_fields='[
  {
    "id": 10000,
    "value": "some value for prop1"
  },
  {
    "id": 10001,
    "value": "some value for prop2"
  }
]'
Where Id = 1234

Update exising ticket with private comment

Update Tickets 
SET comment_body='Closing this ticket'
  , comment_public = 0 --or 1
  , status='solved' --pending, new, closed
  --, comment_body_html='Closing <b>this</b> ticket'
  --, comment_author_id=123545   
Where Id = 1234

Update exising ticket with HTML body

Update Tickets 
SET comment_body_html='Closing <b>this</b> ticket'
  , status='solved' --pending, new, closed
  --, comment_author_id=123545   
  --, comment_public = 0 --or 1  
Where Id = 1234

Update an existing ticket using Raw JSON Body approach

UPDATE Tickets
SET _rawdoc_ =
  '{
      "subject": "Test ticket #1",    
      "comment": {
        "body": "Test ticket #1"
      },
      "priority": "urgent"
    }'
WHERE Id=1234

put_ticket endpoint belongs to Tickets table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Update ticket by Id

DECLARE @MyQuery NVARCHAR(MAX) = 'Update Tickets 
SET subject=''Test ticket subject''
  , tags=''["tag1","tag2"]'' 
  --, additional_tags =''["tag1","tag2"]'' --tags you like to remove
  --, remove tags=''["tag1","tag2"]''
  , status=''pending'' --new, solved, closed
  --below json can be obtained using select custom_fields from tickets where id=1234
  , custom_fields=''[
  {
    "id": 10000,
    "value": "some value for prop1"
  },
  {
    "id": 10001,
    "value": "some value for prop2"
  }
]''
Where Id = 1234';

EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];

Update exising ticket with private comment

DECLARE @MyQuery NVARCHAR(MAX) = 'Update Tickets 
SET comment_body=''Closing this ticket''
  , comment_public = 0 --or 1
  , status=''solved'' --pending, new, closed
  --, comment_body_html=''Closing <b>this</b> ticket''
  --, comment_author_id=123545   
Where Id = 1234';

EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];

Update exising ticket with HTML body

DECLARE @MyQuery NVARCHAR(MAX) = 'Update Tickets 
SET comment_body_html=''Closing <b>this</b> ticket''
  , status=''solved'' --pending, new, closed
  --, comment_author_id=123545   
  --, comment_public = 0 --or 1  
Where Id = 1234';

EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];

Update an existing ticket using Raw JSON Body approach

DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Tickets
SET _rawdoc_ =
  ''{
      "subject": "Test ticket #1",    
      "comment": {
        "body": "Test ticket #1"
      },
      "priority": "urgent"
    }''
WHERE Id=1234';

EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];

put_ticket endpoint belongs to Tickets table(s), and can therefore be used via those table(s).