Ticket Events

On adding a comment

When a user adds a comment to a ticket from UI, the ticket_comment.add event is broadcasted along with comment details. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format.

FieldField typeDescription
commentIdStringID of the comment
isPublicCommentBooleanKey that specifies if the comment is public or private
displayTimeStringTime when the comment was added
displayNameStringName of the user who added the comment
commentStringContent of the comment
 

Sample Request

CopiedApp.instance.on("ticket_comment.add", function(data){
    //data gives the comment detail
})

Sample Response

Copied{
    comment: "<div>Hello</div>",
    commentId: "90108000000847123",
    displayName: "Agent Name",
    displayTime: "09 Jun 2021 06:34 PM",
    isPublicComment: true
}

 

On opening the ticket replyeditor

When a user opens the reply editor of a ticket, the ticket_replyEditor.opened event is broadcasteded along with details of the reply editor. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format.

FieldField TypeDescription
modeStringMode of the reply editor: reply or replyAll
threadIdStringID of the thread opened
ticketIdStringID of the ticket
 

Sample Request

CopiedApp.instance.on("ticket_replyEditor.opened", function(data){
    //data gives the comment detail
})

Sample Response

Copied{
    mode: "replyAll",
    threadId: "90108000000495471",
    ticketId: "20400443020642124"
}

 

On changing the values in custom fields

When a user changes the value in a custom field on the left panel of the ticket detail page, the ticket_customFields.changed event is broadcasted along with the new value in the field. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction
 

Sample Request

CopiedApp.instance.on("ticket_customFields.changed", function(data){
    //data gives the comment detail
})

Sample Response

Copied{
    ticket.customFields:
    {
        customField1:"Value 1",
        customField2:"Value 2"
    }
}

 

On marking a task as completed

When a user marks a task as complete, the task_Completed event is broadcasted. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony

The response/data sent to the extension will be in the following format

FieldField TypeDescription
task_CompletedBooleanKey that specifies if the task is completed or not
 

Sample Request

CopiedApp.instance.on("task_Completed", function(data){
    //data gives the Article Id
})

Sample Response

Copied{
    task_Completed: true
}

 

On opening a topic in the user community

When a user opens a forum topic in the Community module, the community.topic.loaded event is broadcasted along with the ID of the topic. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony

The response/data sent to the extension will be in the following format

FieldField TypeDescription
topicIdStringID of the forum topic
 

Sample Request

CopiedApp.instance.on("community.topic.loaded", function(data){
    //data gives the Article Id
})

Sample Response

Copied{
    topicId: "50138000520495421"
}

 

On changing the assignee of ticket

When a user changes the assignee of a ticket, the ticket_assignee.changed event is triggered along with the details of the new assignee. This event allows you to change the ticket from one assignee to another assignee.This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
typestringType of ticket owner. Values allowed are: Unassigned, agent, team, and teamAgent
agentObjectDetails of the agent. This key is returned only if the owner is an individual agent or an agent from a team.Sent in format AGENT_OBJECT
teamObjectDetails of the team. This key is returned only if the owner is a team or an agent from a team.Sent in format TEAM_OBJECT

AGENT_OBJECT

FieldField TypeDescription
idStringID of the agent
firstNameStringFirst name of the agent
lastNameStringLast name of the agent
fullNameStringFull name of the agent
emailStringEmail of the agent

TEAM_OBJECT

FieldField TypeDescription
idStringID of the team
nameStringName of the team
descriptionStringDescription of the team
departmentIdStringID of the department to which the team belongs
 

Sample Request

CopiedApp.instance.on("ticket_assignee.changed", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    ticket.owner: {
        type: "teamAgent",
        agent: {
            id: "90108000000190123",
            firstName: "NewAgent",
            lastName: "",
            fullName: "NewAgent",
            email: "NewAgent@something.com"
        },
        team: {
            name: "newteam",
            id: "901080000012345",
            description: "description of team",
            departmentId: "90108000003700987"
        }
    }
}

 

On changing the owner of ticket

When a user changes the owner of a ticket, the ticket_owner.changed event is broadcasted along with the details of the new owner. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
typestringType of ticket owner. Values allowed are: Unassigned, agent, team, and teamAgent
agentObjectDetails of the agent. This key is returned only if the owner is an individual agent or an agent from a team.Sent in format AGENT_OBJECT
teamObjectDetails of the team. This key is returned only if the owner is a team or an agent from a team.Sent in format TEAM_OBJECT

Note: The ticket_owner.changed event will be replaced with ticket_assignee.changed event, so as a new user, you can use ticket_assignee.changed event to change the assignee of the ticket. As of now, both events are supported.

 

Sample Request

CopiedApp.instance.on("ticket_owner.changed", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    ticket.owner: {
        type: "teamAgent",
        agent: {
            id: "90108000000190123",
            firstName: "NewAgent",
            lastName: "",
            fullName: "NewAgent",
            email: "NewAgent@something.com"
        },
        team: {
            name: "newteam",
            id: "901080000012345",
            description: "description of team",
            departmentId: "90108000003700987"
        }
    }
}

 

On moving to a different page

When a user moves from one page to another on their Zoho Desk portal, the pageChange event is broadcasteded along with details of the current view and previous view. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony

The response/data sent to the extension will be in the following format

FieldField TypeDescription
previousViewObjectDetails of the previous page.Sent in format #PREVIOUS_VIEW_OBJECT
currentViewObjectDetails of the current page.Sent in format #CURRENT_VIEW_OBJECT

#PREVIOUS_VIEW_OBJECT

FieldField TypeDescription
moduleStringModule to which the page belongs, ticket, contact, kb, dashboard, social, chat, extension, setup, community, report, task, activity, call, event, teamFeed, kb, account
pageStringType of the page: addForm, detail, editForm, list, dashboard, postDetail, forum, manage

#CURRENT_VIEW_OBJECT

FieldField TypeDescription
moduleStringModule to which the page belongs, ticket, contact, kb, dashboard, social, chat, extension, setup, community, report, task, activity, call, event, teamFeed, kb, account
pageStringType of the page: addForm, detail, editForm, list, dashboard, postDetail, forum, manage
 

Sample Request

CopiedApp.instance.on("pageChange", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    previousView: {
        module: "ticket",
        page: "list"
    },
    currentView: {
        module: "ticket",
        page: "detail"
    }
}

 

On changing or applying a response template in the ticket reply editor

When a user applies or changes a response template on the ticket reply editor, the ticket_replyEditor_template.loaded event is broadcasted along with the content of the template and ID of the thread. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
contentstringContent of the template
idObjectID of the template
 

Sample Request

CopiedApp.instance.on("ticket_replyEditor_template.loaded", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    content: "Html Content of the template",
    id: "98787662312400000"
}

 

On moving from one ticket to another

When the user clicks a different ticket in the All Tickets view on the left panel, the ticket_Shift event is broadcasteded. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket_shiftedBooleanKey that specifies if the ticket was loaded from the left panel of the ticket detail page
 

Sample Request

CopiedApp.instance.on("ticket_Shift", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    ticket_shifted: true
}

 

On changing the due date of a ticket

When a user changes the due date of a ticket, the ticket_dueDate.changed event is broadcasted along with the details of the updated due date. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.dueDateBooleanUpdated due date and time for resolving the ticket
 

Sample Request

CopiedApp.instance.on("ticket_dueDate.changed", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    ticket.dueDate :"08/15/2022 12:00 PM"
}

 

On changing the value in a field

When a user changes the value in a field in the add ticket/contact/account form, the ${module}Form_${fieldName}.changed event is broadcasted along with details of the old and updated values in the field. This event will be broadcasted for every key stoke that changes the value of the field. This event can be accessed from the following widget locations.

  • desk.ticket.form.rightpanel
  • desk.contact.form.rightpanel
  • desk.account.form.rightpanel

The response/data sent to the extension will be in the following format

FieldField TypeDescription
${module}Form.${fieldName}ObjectValues of the specified field:Sent in format #OBJECT

#OBJECT

FieldField TypeDescription
oldValueStringPrevious value in the field
newValueStringUpdated value in the field
 

Sample Request

CopiedApp.instance.on('ticketForm_email.changed', function(data){
    //data gives the email value available in the field
    })

Sample Response

Copied{
    ticketForm.email: {
        oldValue: "email@gmail.com",
        newValue: "email@gmail.com"
    }
}

 

On changing the priority of a ticket

When a user changes the priority of a ticket and clicks the save button, the ticket_priority.changed event is broadcasted along with the details of the updated priority value. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.priorityStringPriority of the ticket
 

Sample Request

CopiedApp.instance.on("ticket_priority.changed", function(data){
    //data gives the new owner details
})

Sample Response

Copied{
    ticket.priority :"Low"
}

 

On changing the classification of a ticket

When a user changes the classification of a ticket and clicks the save button, the ticket_classification.changed event is broadcasted along with the details of the updated classification value. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.classificationStringClassification of the ticket
 

Sample Request

CopiedApp.instance.on("ticket_classification.changed", function(data){
    //data gives the classification changed
})

Sample Response

Copied{
    ticket.classification :"Feature"
}

 

On changing the product associated with a ticket

When a user changes the product associated with a ticket and clicks the save button, the ticket_productName.changed event is broadcasted along with the details of the newly associated product. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.productNameStringName of the product newly associated with the ticket
 

Sample Request

CopiedApp.instance.on("ticket_productName.changed", function(data){
    //data gives the productname changed
})

Sample Response

Copied{
    ticket.productName :"Finance"
}

 

On changing the phone number of a ticket

When a user changes the phone number of a ticket and clicks the save button, the ticket_phone.changed event is broadcasted along with the new phone number. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.phoneStringNew phone number updated in the ticket
 

Sample Request

CopiedApp.instance.on("ticket_phone.changed", function(data){
    //data gives the phone changed
})

Sample Response

Copied{
    ticket.phone :"1 888 900 9646"
}

 

On changing the status of a ticket

When a user changes the status of a ticket, the ticket_status.changed event is broadcasted along with the details of the updated status value. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.statusStringStatus of the ticket
 

Sample Request

CopiedApp.instance.on("ticket_status.changed", function(data){
    //data gives the status changed
})

Sample Response

Copied{
    ticket.status :"Open"
}

 

 

On changing the spam status of a ticket

When a user Marks a ticket as spam/Not spam , the ticket_isSpam.changed event is broadcasted along with the details of the spam status. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab

The response/data sent to the extension will be in the following format

FieldField TypeDescription
ticket.isSpamStringSpam Status of the ticket
 

Sample Request

CopiedApp.instance.on("ticket_isSpam.changed", function (data) {
 //data gives the status changed
  console.log(data);
 })

Sample Response

Copied{
"ticket.isSpam": "true"
}

 

On opening remote assist

When a user initiates a Remote Assist session on the ticket detail view, the ticket_assist.click event is broadcasted along with the status, owner, due date, and ID of the ticket. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
statusStringStatus of the ticket
ownerStringAgent name if ticket was assigned to an agent / Team nameif ticket was assigned to a team or agent of the team / Unassigned if the ticket is not assigned to any agent/team
dueDateStringDue date of the ticket / No Due Date Set
ticketIdStringID of the ticket
 

Sample Request

CopiedApp.instance.on("ticket_assist.click", function(data){
    //data gives the ticket details
})

Sample Response

Copied{
    status: "Open",
    owner:  "newTeam",
    dueDate:  "No Due Date set",
    ticketId:  "26811000000760569"
}

 

On closing a modal box

When a modal box is closed, the 'modal.closed' event will broadcast with empty response data. The custom logic will have only information that the modal box is closed.

 

Sample Request

CopiedApp.instance.on("modal.closed", function(data){
//data will be empty
})

 

On changing the user preference

When a user preferences such as theme, fontFamily, or appearance is changed, 'user_preference.changed' event will be broadcasted. Using the response data from the event, the extension can change the appearance of its widget.

The Response data of the event will have the following data

FieldField TypeDescription
themeStringTheme of the desk UI
fontFamilyStringfontFamily of the desk UI
appearanceStringappearance of the desk UI
 

Sample Request

CopiedApp.instance.on("user_preference.changed", function(data){
    //data gives the theme details
})

Sample Response

Copied{
"theme": "yellow"
}

Call Events

On receiving a call

When an agent receives a call, the call.ringing event is broadcasted along with the phone number of the contact. Contact ID is included if the contact already exists in your portal. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction
  • desk.contact.detail.rightpanel
  • desk.contact.detail.subtab
  • desk.contact.detail.lefttab
  • desk.contact.detail.moreaction
  • desk.account.detail.rightpanel
  • desk.account.detail.subtab
  • desk.account.detail.lefttab
  • desk.account.detail.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
caseIdStringID of the ticket
contactIdStringID of the contact
callTypeStringType of the call: outbound or inbound
numberStringPhone number of the Contact
entityNameStringEntity Name
callStateStringState of the call( "ringing", "proceedanswer", "completed" )
ctinumberStringCTI number of the contact
caseNumberStringTicket number
isCallAssociatedBooleanKey that specifies if the call is associated with a ticket or not
ztiCallIdStringZTI ID of the call
 

Sample Request

CopiedApp.instance.on("call.ringing", function(data){
    //ddata gives the call information
})

Sample Response

Copied{
    caseId: "901080000005819",
    contactId: "901080000004554",
    callType: "outbound",
    number: "9837650000",
    entityName: "new contact",
    callState: "ringing",
    ctinumber: "",
    caseNumber: "193",
    isCallAssociated: true,
    ztiCallId: "901080000007820"
}

 

On answering a call

When an agent answers a call, the call.answered event is broadcasted along with the phone number of the contact. Contact ID is included if the contact already exists in your portal. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction
  • desk.contact.detail.rightpanel
  • desk.contact.detail.subtab
  • desk.contact.detail.lefttab
  • desk.contact.detail.moreaction
  • desk.account.detail.rightpanel
  • desk.account.detail.subtab
  • desk.account.detail.lefttab
  • desk.account.detail.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
caseIdStringID of the ticket
activityIdStringID of the Activity
contactIdStringID of the contact
callTypeStringType of the call: outbound or inbound
numberStringPhone number of the Contact
entityNameStringEntity Name
callStateStringState of the call( "ringing", "proceedanswer", "completed" )
ctinumberStringCTI number of the contact
caseNumberStringTicket number
isCallAssociatedBooleanKey that specifies if the call is associated with a ticket or not
ztiCallIdStringZTI ID of the call
 

Sample Request

CopiedApp.instance.on("call.answered", function(data){
    //ddata gives the call information
})

Sample Response

Copied{
    caseId: "901080000005816",
    activityId: "901080000007003",
    contactId: "901080000004554",
    callType: "outbound",
    number: "",
    entityName: "new contact",
    callState: "proceedanswer",
    ctinumber: "",
    caseNumber: "193",
    isCallAssociated: true,
    ztiCallId: "901080000007821"
}

 

On completing a call

When an agent completes the conversation with the customer and disconnects the call, the call.completed event is broadcasted along with the phone number of the contact. Contact ID is included if the contact already exists in your portal. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction
  • desk.contact.detail.rightpanel
  • desk.contact.detail.subtab
  • desk.contact.detail.lefttab
  • desk.contact.detail.moreaction
  • desk.account.detail.rightpanel
  • desk.account.detail.subtab
  • desk.account.detail.lefttab
  • desk.account.detail.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
caseIdStringID of the ticket
activityIdStringID of the Activity
contactIdStringID of the contact
callTypeStringType of the call: outbound or inbound
numberStringPhone number of the Contact
entityNameStringEntity Name
callStateStringState of the call( "ringing", "proceedanswer", "completed" )
ctinumberStringCTI number of the contact
caseNumberStringTicket number
isCallAssociatedBooleanKey that specifies if the call is associated with a ticket or not
ztiCallIdStringZTI ID of the call
 

Sample Request

CopiedApp.instance.on("call.completed", function(data){
    //ddata gives the call information
})

Sample Response

Copied{
    caseId: "901080000005816",
    activityId: "901080000007003",
    contactId: "901080000004554",
    callType: "outbound",
    number: "",
    entityName: "new contact",
    callState: "proceedanswer",
    ctinumber: "",
    caseNumber: "193",
    isCallAssociated: true,
    ztiCallId: "901080000007821"
}

 

On making a call

When a user makes a call from the ticket/contact/account/activity detail view or from the call reminder pop-up or from the dial pad, the click2Call event is broadcasted along with details of the location from where the call is made and the ID of the resource (ticket/contact/account/activity) associated. This event can be accessed from the following widget locations.

  • desk.background
  • desk.bottomband
  • desk.extension.telephony
  • desk.ticket.detail.rightpanel
  • desk.ticket.detail.subtab
  • desk.ticket.detail.lefttab
  • desk.ticket.detail.moreaction
  • desk.ticket.thread.moreaction
  • desk.contact.detail.rightpanel
  • desk.contact.detail.subtab
  • desk.contact.detail.lefttab
  • desk.contact.detail.moreaction
  • desk.account.detail.rightpanel
  • desk.account.detail.subtab
  • desk.account.detail.lefttab
  • desk.account.detail.moreaction

The response/data sent to the extension will be in the following format

FieldField TypeDescription
contextStringName of the module from which the call was made ( ticket/contact/activity .detail.view, dial.pad, reminder.popUp )
caseIdStringID of the ticket
contactIdStringID of the contact
activityIdStringID of the Activity

Sample Request

CopiedApp.instance.on("click2Call", function(data){
    //data gives the call information
})

Sample Response

Copied{
    context: "ticket.detail.page",
    contactId:"123456789", 
    caseId: "1234565234",
    activityId: "1241351321"
}