Configure onConversationCreate

Marketplace Platform v2.3 deprecation:We’re continuing to improve the Marketplace Platform to deliver stronger security, better performance, and new capabilities. As part of this evolution, Marketplace Platform v2.3 will be deprecated. To learn the dates and next steps, see Migration guide.

onConversationCreate

When a reply or note is added to a ticket, the onConversationCreate event is invoked and the registered callback method is executed.

The supported conversation create events are:

  • Reply added
  • Public note added
  • Private note added

Subscribe to the onConversationCreate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onConversationCreate": {
    "handler": "onConversationCreateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onConversationCreateCallback: function(payload) {
    console.log("Logging arguments from onConversationCreate event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the system, agent, or requester who triggered the onConversationCreate event in the Freshservice system.

    • profile_idinteger

      Identifier of the actor who triggered the product event.

  • conversationobject

    Information pertaining to the conversation when the onConversationCreate event is triggered in the Freshservice system.

    • attachmentsarray of objects

      Attachments associated with the conversation.

    • bcc_emailsarray of strings

      Email address added in the bcc field of the outgoing ticket email.

    • bodystring

      Content of the conversation in HTML. This content is truncated if it exceeds 10 KB.

    • body_textstring

      Content of the conversation in plain text. This content is truncated if it exceeds 10 KB.

    • cc_emailsarray of strings

      Email addresses added in the cc field of the incoming ticket email.

    • created_atstring

      Conversation creation timestamp in the UTC format, YYYY-MM-DDTHH:MM:SSZ. Example: 2016-02-13T23:27:49Z

    • from_emailstring

      The email address from which the reply is sent. By default, the global support email is used.

    • idinteger

      ID of the conversation.

    • incomingboolean

      Specifies whether a particular conversation should appear as if it was created externally, meaning not through a web portal.

      Possible values: true, false

    • is_body_text_truncatedboolean

      Specifies whether body_text is truncated.

      Possible values: true, false

    • is_body_truncatedboolean

      Specifies whether body is truncated.

      Possible values: true, false

    • privateboolean

      Specifies whether the conversation is a private note.

      Possible values: true, false

    • sourceinteger

      Denotes the type of conversation.

      Possible values:

      • 0: Reply
      • 2: Note
      • 5: Created from tweets
      • 6: Created from survey feedback
      • 7: Created from Facebook post
      • 8: Created from forwarded email
      • 9: Created from phone
      • 10: Created from Mobihelp
      • 11: E-Commerce
    • supporting_emailstring

      Email address from which the reply is sent. For notes, this value will be null.

    • ticket_idinteger

      ID of the ticket to which the conversation is being added.

    • ticket_workspace_idinteger

      Important:When the onConversationCreate event is triggered in accounts without workspaces or with the MSP mode enabled, this attribute is not returned in the payload. MSP mode does not support workspaces.

      When a reply or note is added to a ticket, the onConversationCreate event is triggered. This ticket can belong to a specific workspace. A workspace is a configurable, team or department-specific space where team-members can collaborate while maintaining the operational integrity of team-only data.


      ticket_workspace_id is the identifier of the workspace to which the ticket is associated. This value is auto-generated for every workspace, when the workspace is created in Freshservice. For information about workspaces, read What is a workspace. To retrieve all the workspaces that are created in an account, through APIs, use the List all workspaces API.

      Note:ticket_workspace_id is displayed as part of the account URL when you (or the app user) navigate to the admin settings of the workspace. For example, when you navigate to the primary workspace’s admin settings, if the corresponding URL is /ws/2/admin/home, the workspace’s ID is 2.

    • ticket_workspace_namestring

      Name of the workspace associated with the ticket.

      Important:When the onConversationCreate event is triggered in accounts without workspaces or with the MSP mode enabled, this attribute is not returned in the payload. MSP mode does not support workspaces.

    • to_emailsarray of strings

      Email addresses of agents/users who need to be notified about this conversation.

    • updated_atstring

      Ticket updated timestamp in the UTC format, YYYY-MM-DDTHH:MM:SSZ.

      Example: 2016-02-13T23:27:49Z

    • user_idinteger

      Identifier of the agent/user who is adding the conversation.