This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Tickets in Sirportly


Overview

The following operations allow you to work with tickets. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with tickets, see Sample configuration

OperationDescription

addContentToTicket

Adds content to a ticket.

createTicketCreates a new ticket.
getTicketRetrieves ticket properties.
listTicketsRetrieves all tickets.
listTicketsByFilterRetrieves tickets by filter.
updateTicketUpdates ticket properties.
searchTicketsSearches tickets.

Operation details

This section provides further details on the operations related to tickets.

Adding content to a ticket

The addContentToTicket operation posts updates to a ticket. These updates can be either public or private, however the ticket must exist before you can post an update.

addContentToTicket
<sirportly.addContentToTicket>
    <ticketReference>{$ctx:ticketReference}</ticketReference>
	<message>{$ctx:message}</message>
    <subject>{$ctx:subject}</subject>
    <isAuthenticated>{$ctx:isAuthenticated}</isAuthenticated>
    <postedAt>{$ctx:postedAt}</postedAt>
    <htmlBody>{$ctx:htmlBody}</htmlBody>
	<htmlSafe>{$ctx:htmlSafe}</htmlSafe>
</sirportly.addContentToTicket>
Properties
  • ticketReference: Required - The reference of the ticket to be updated.
  • message: Required - The content of the ticket.
  • subject: The subject of the ticket.
  • isAuthenticated: Whether or not this update is authenticated.
  • postedAt: The date/time the updated was posted.
  • htmlBody: The HTML body to show as content.
  • htmlSafe: If this HTML should be displayed within the staff interface to users, this value should be sent as '1'. If this is not sent, the HTML body will be escaped when displayed to the user.
   Sample request

Following is a sample REST/JSON request that can be handled by the addContentToTicket operation.

Sample Request for addContentToTicket
{
	"apiUrl":"https://anusoft.sirportly.com",
	"apiToken":"007898a0-d9e7-3d5a-f6e2-c1a7d3853555",
	"apiSecret":"rrcxnqny86nrpxec0riiyufd4mylt45kr2l2bltsb435u5y68i",
	"ticketReference" : "ZR-194119",
	"message" : "Test from SOAP"
}
Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/posting-an-update

Creating a new ticket

The createTicket operation submits a new ticket into the support site.

createTicket
</sirportly.init>
    <sirportly.createTicket>
    <subject>{$ctx:subject}</subject>
    <status>{$ctx:status}</status>
    <priority>{$ctx:priority}</priority>
    <sla>{$ctx:sla}</sla>
    <brand>{$ctx:brand}</brand>
    <department>{$ctx:department}</department>
    <team>{$ctx:team}</team>
    <assignedUser>{$ctx:assignedUser}</assignedUser>
	<submittedAt>{$ctx:submittedAt}</submittedAt>
    <customFields>{$ctx:customFields}</customFields>
    <contact>{$ctx:contact}</contact>
    <contactMethod>{$ctx:contactMethod}</contactMethod>
    <contactMethodType>{$ctx:contactMethodType}</contactMethodType>
    <contactMethodData>{$ctx:contactMethodData}</contactMethodData>
    <contactName>{$ctx:contactName}</contactName>
	<additionalContactMethods>{$ctx:additionalContactMethods}</additionalContactMethods>
</sirportly.createTicket>
Properties
  • subject: The subject for the ticket.
  • status: The name or the ID of the status.
  • priority: The name or ID of the ticket priority.
  • sla: The name or ID of the SLA.
  • brand: The name or ID of the brand.
  • department: The name or ID of the department.
  • team: The name or ID of the team.
  • assignedUser: The username or ID of an assigned user.
  • submittedAt: The date/time the ticket was created.
  • customFields: The JSON object containing custom field values.
  • contact: The ID of an existing contact.
  • contactMethod: The ID of the existing contact method.
  • contactMethodType: The type of contact method to use.
  • contactMethodData: The e-mail address or telephone number of the contact method.
  • contactName: The name of the contact.
  • additionalContactMethods: The comma  additional contact methods list.
   Sample request

Following is a sample REST/JSON request that can be handled by the createTicket operation.

Sample Request for createTicket
{
	"apiUrl" : "https://virasoft.sirportly.com",
	"apiToken" : "e6fd7f4b-02d1-a8bf-0407-c9038ed9ebe7",
	"apiSecret" : "rik5x53atxj550gqzylpgfy7lkbrbmsqgamse1ypiyih304crp",
	"subject" : "Test Subject",
	"status" : "New",
	"priority" : "Normal",
	"department" : "16630",
	"team" : "8833",
	"sla" : "NoValidate",
	"brand" : "7645",
	"assignedUser" : "12253",
	"submittedAt" : "2015-05-25",
	"customFields" : {
		"custom[telephone]" : "0112583695"
	},
	"contact" : "4072366",
	"contactMethod" : "email",
	"contactMethodType" : "email",
	"contactMethodData" : "apptest.virajith@gmail.com",
	"contactName" : "App Vira",
	"additionalContactMethods" : "4072312"
}
Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/submitting-a-new-ticket

Retrieving ticket properties

The getTicket operation retrieves ticket properties.

getTicket
<sirportly.getTicket>
    <ticketReference>{$ctx:ticketReference}</ticketReference>
    <isRetrieveTimers>{$ctx:isRetrieveTimers}</isRetrieveTimers>
	<markAsRead>{$ctx:markAsRead}</markAsRead>
</sirportly.getTicket>
Properties
  • ticketReference: The reference of the ticket to be fetched.
  • isRetrieveTimers: The flag to include ticket timers in the response.
  • markAsRead: The flag to mark all notifications regarding this ticket as read.
   Sample request

Following is a sample REST/JSON request that can be handled by the getTicket operation.

Sample Request for getTicket
{
	"apiUrl" : "https://virasoft.sirportly.com",
	"apiToken" : "e6fd7f4b-02d1-a8bf-0407-c9038ed9ebe7",
	"apiSecret" : "rik5x53atxj550gqzylpgfy7lkbrbmsqgamse1ypiyih304crp",
	"ticketReference" : "TA-930538",
	"isRetrieveTimers" : "1",
	"markAsRead" : "1"
}
Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/getting-all-ticket-properties

Retrieving all tickets

The listTickets operation retrieves all tickets which are stored in the database.

listTickets
<sirportly.listTickets>
    <page>{$ctx:page}</page>
    <sortBy>{$ctx:sortBy}</sortBy>
	<orderBy>{$ctx:orderBy}</orderBy>
</sirportly.listTickets>
Properties
  • page: The page number to retrieve for pagination.
  • sortBy: The name of the field to sort results.
  • orderBy: One of the asc or desc types for the sorting order.
   Sample request

Following is a sample REST/JSON request that can be handled by the listTickets operation.

Sample Request for listTickets
{
	"apiUrl" : "https://virasoft.sirportly.com",
	"apiToken" : "e6fd7f4b-02d1-a8bf-0407-c9038ed9ebe7",
	"apiSecret" : "rik5x53atxj550gqzylpgfy7lkbrbmsqgamse1ypiyih304crp",
	"page" : "1",
	"sortBy" : "created_at",
	"orderBy" : "desc"
}
Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/listing-all-tickets

Retrieving tickets by filter 

The listTicketsByFilter operation retrieves tickets which match a filter. 

listTicketsByFilter
<sirportly.listTicketsByFilter>
	<filter>{$ctx:filter}</filter>
    <user>{$ctx:user}</user>
    <page>{$ctx:page}</page>
    <sortBy>{$ctx:sortBy}</sortBy>
    <orderBy>{$ctx:orderBy}</orderBy>
    <conditions>{$ctx:conditions}</conditions>
	<isRawTicket>{$ctx:isRawTicket}</isRawTicket>
</sirportly.listTicketsByFilter>
Properties
  • filter: Required - The name or ID of the filter to be used.
  • user: The username or ID of the user to be filtered.
  • page: The page number to return tickets for.
  • sortBy: The name of the field to sort results.
  • orderBy: One of the asc or desc types for the sorting order.
  • conditions: The additional conditions which will be added to the filter query.
  • isRawTicket: The flag to retrieve full ticket information.
   Sample request

Following is a sample REST/JSON request that can be handled by the listTicketsByFilter operation.

Sample Request for listTicketsByFilter
{
	"apiUrl" : "https://virasoft.sirportly.com",
	"apiToken" : "e6fd7f4b-02d1-a8bf-0407-c9038ed9ebe7",
	"apiSecret" : "rik5x53atxj550gqzylpgfy7lkbrbmsqgamse1ypiyih304crp",
	"filter" : "All Tickets",
	"user" : "12253",
	"page" : "1",
	"sortBy" : "created_at",
	"orderBy" : "asc",
	"conditions" : "conditions[status]=New&conditions[priority]=High",
	"isRawTicket" : "1"
}
Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/listing-tickets-by-filter

Updating ticket properties

The updateTicket operation updates the properties associated with a ticket. 

updateTicket
<sirportly.updateTicket>
	<ticketReference>{$ctx:ticketReference}</ticketReference>
    <status>{$ctx:status}</status>
    <priority>{$ctx:priority}</priority>
    <departmentId>{$ctx:departmentId}</departmentId>
    <sla>{$ctx:sla}</sla>
    <team>{$ctx:team}</team>
    <assignedUser>{$ctx:assignedUser}</assignedUser>
    <subject>{$ctx:subject}</subject>
    <tagList>{$ctx:tagList}</tagList>
    <updatedAt>{$ctx:updatedAt}</updatedAt>
    <replyDueAt>{$ctx:replyDueAt}</replyDueAt>
    <resolutionDueAt>{$ctx:resolutionDueAt}</resolutionDueAt>
    <contactMethod>{$ctx:contactMethod}</contactMethod>
    <contactMethodData>{$ctx:contactMethodData}</contactMethodData>
    <contactName>{$ctx:contactName}</contactName>
    <additionalContactMethods>{$ctx:additionalContactMethods}</additionalContactMethods>
	<customFields>{$ctx:customFields}</customFields>
</sirportly.updateTicket>
Properties
  • ticketReference: Required - The reference of the ticket to be updated.
  • status: The name or ID of the new status.
  • priority: The name or ID of the new priority.
  • departmentId: The ID of the new department.
  • sla: The name or ID of the new SLA.
  • team: The name or ID of the new team.
  • assignedUser: The username or ID of the user to be assigned.
  • subject: The subject of the ticket.
  • tagList: The space separated list of tags for the ticket.
  • updatedAt: The date/time the ticket was updated.
  • replyDueAt: The date/time the ticket reply is due.
  • resolutionDueAt: The date/time the ticket resolution is due.
  • contactMethod: The ID of the contact method to be assigned.
  • contactMethodData: The e-mail address or telephone number of the contact method.
  • contactName: The The name of the contact.
  • additionalContactMethods: The comma separated additional contact methods list.
  • customFields: The JSON object containing custom field values.
   Sample request

Following is a sample REST/JSON request that can be handled by the updateTicket operation.

Sample Request for updateTicket
{
	"apiUrl" : "https://virasoft.sirportly.com",
	"apiToken" : "e6fd7f4b-02d1-a8bf-0407-c9038ed9ebe7",
	"apiSecret" : "rik5x53atxj550gqzylpgfy7lkbrbmsqgamse1ypiyih304crp",
	"ticketReference" : "HL-364011",
	"status" : "New",
	"priority" : "High",
	"departmentId" : "16630",
	"sla" : "NoValidate",
	"team" : "8833",
	"assignedUser" : "12253",
	"subject" : "New Subject",
	"tagList" : "IT Hardware",
	"updatedAt" : "2015-05-25",
	"replyDueAt" : "2015-05-38",
	"resolutionDueAt" : "2015-05-30",
	"customFields" : {
		"custom[Estimation]" : "3000",
		"custom[IsBillable]" : "False"
	},
	"additionalContactMethods" : "4072366"
}

Note

There are optional parameters available. For more information on the usage of these parameters please check the API document. 

Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/changing-ticket-properties

Searching tickets

The searchTickets operation searches for tickets using the full text support. 

searchTickets
<sirportly.searchTickets>
    <query>{$ctx:query}</query>
	<page>{$ctx:page}</page>
</sirportly.searchTickets>
Properties
  • query: Required - The query string to search tickets.
  • page: The page number for paginated responses.
   Sample request

Following is a sample REST/JSON request that can be handled by the searchTickets operation.

Sample Request for searchTickets
{
	"apiUrl" : "https://virasoft.sirportly.com",
	"apiToken" : "e6fd7f4b-02d1-a8bf-0407-c9038ed9ebe7",
	"apiSecret" : "rik5x53atxj550gqzylpgfy7lkbrbmsqgamse1ypiyih304crp",
	"query" : "Logging test",
	"page" : "1"
}
Related Sirportly documentation

https://sirportly.com/docs/api-specification/tickets/searching-tickets

Sample configuration

Following is a sample proxy service that illustrates how to connect to Sirportly with the init operation and use the addContentToTicket operation. The sample request for this proxy can be found in the addContentToTicket  sample request.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="sirportly_addContentToTicket"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiToken" expression="json-eval($.apiToken)"/>
         <property name="apiSecret" expression="json-eval($.apiSecret)"/>
         <property name="ticketReference" expression="json-eval($.ticketReference)"/>
         <property name="message" expression="json-eval($.message)"/>
         <property name="subject" expression="json-eval($.subject)"/>
         <property name="isAuthenticated" expression="json-eval($.isAuthenticated)"/>
         <property name="postedAt" expression="json-eval($.postedAt)"/>
         <property name="htmlBody" expression="json-eval($.htmlBody)"/>
         <property name="htmlSafe" expression="json-eval($.htmlSafe)"/>
	     <sirportly.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiToken>{$ctx:apiToken}</apiToken>
            <apiSecret>{$ctx:apiSecret}</apiSecret>
         </sirportly.init>
         <sirportly.addContentToTicket>
            <ticketReference>{$ctx:ticketReference}</ticketReference>
            <message>{$ctx:message}</message>
            <subject>{$ctx:subject}</subject>
            <isAuthenticated>{$ctx:isAuthenticated}</isAuthenticated>
            <postedAt>{$ctx:postedAt}</postedAt>
            <htmlBody>{$ctx:htmlBody}</htmlBody>
            <htmlSafe>{$ctx:htmlSafe}</htmlSafe>
         </sirportly.addContentToTicket>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>