Merge Tickets into Target Ticket

POST {{baseUrl}}/api/v2/tickets/:ticket_id/merge

Merges one or more tickets into the ticket with the specified id.

See Merging tickets in the Support Help Center for ticket merging rules.

Any attachment to the source ticket is copied to the target ticket.

This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job's completion.

Allowed For

  • Agents

Agents in the Enterprise account must have merge permissions. See Creating custom roles and assigning agents (Enterprise) in the Support Help Center.

Available parameters

The request takes a data object with the following properties:

NameTypeRequiredComments
idsarrayyesIds of tickets to merge into the target ticket
target_commentstringnoPrivate comment to add to the target ticket
source_commentstringnoPrivate comment to add to the source ticket
targetcommentis_publicbooleannoWhether comment in target ticket is public or private
sourcecommentis_publicbooleannoWhether comment in source tickets are public or private

The comments are optional but strongly recommended.

Comments are private and can't be modified in the following cases:

  • Any of the sources or target tickets are private
  • Any of the sources or target tickets were created through Twitter, Facebook or the Channel framework

In any other case, comments default to private but can be modified with the comment privacy parameters.

Request Body

{"ids"=>"<array>", "source_comment"=>"<string>", "source_comment_is_public"=>"<boolean>", "target_comment"=>"<string>", "target_comment_is_public"=>"<boolean>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;job_status&quot;:{&quot;id&quot;:&quot;82de0b044094f0c67893ac9fe64f1a99&quot;,&quot;message&quot;:&quot;Completed at 2018-03-08 10:07:04 +0000&quot;,&quot;progress&quot;:2,&quot;results&quot;:[{&quot;action&quot;:&quot;update&quot;,&quot;id&quot;:244,&quot;status&quot;:&quot;Updated&quot;,&quot;success&quot;:true},{&quot;action&quot;:&quot;update&quot;,&quot;id&quot;:245,&quot;status&quot;:&quot;Updated&quot;,&quot;success&quot;:true}],&quot;status&quot;:&quot;completed&quot;,&quot;total&quot;:2,&quot;url&quot;:&quot;https://example.zendesk.com/api/v2/job_statuses/82de0b0467893ac9fe64f1a99.json&quot;}}