Skip to main content
Class for representing an SuperOffice Service Ticket.

Constructors

Ticket()

Class for representing an SuperOffice Service Ticket.

Methods

buildEmailSubject()

returns a String composed by the Mail tag, the ticketId and the title of the ticket
Returns: CRMScript.Global.String - A String composed by the Mail tag, the ticketId and the title of the ticket.

checkEscalating(Integer)

This function does a check according to the ticket’s priority and the input action. The effect of calling this function might be that the escalation stops, restarts or continues.
Returns: CRMScript.Global.Void
Possible values:
  • ActionRead = 0
  • ActionChangedOwner = 1
  • ActionNewInfo = 2
  • ActionClosed = 3
  • ActionChangedPriority = 4
  • ActionNew = 5

delegate()

Delegates a ticket to a user according to the rules on the category. For this function to take effect, you have to call <code>Ticket.save()</code>.
Returns: CRMScript.Global.Void

delegate(Integer)

Delegates a ticket to a user according to the rules on the category. You can optionally specify a user ID not to delegate to. For this function to take effect, you have to call <code>Ticket.save()</code>.
Returns: CRMScript.Global.Void

getInvolvedOnly()

Returns a comma-separated list of the email-addresses of all customers that is not a connected customer to this ticket, but who has received a message on this ticket.
Returns: CRMScript.Global.String - A comma-separated list of email-addresses.

getMailFrom()

This function determines and returns the most appropriate from-address, when sending a mail-message on a ticket.
Returns: CRMScript.Global.String - The most appropriate from-address specified on with address, the ticket has arrived on, the category, etc.

getOwnerEmail()

This function returns the owner of the ticket printed as “Name” <email-addr>.
Returns: CRMScript.Global.String - The owners name and email-address.

getOwnerSms()

This function returns the cellphone number of the owner of the ticket
Returns: CRMScript.Global.String - The cellphone number of the owner of the ticket as a String.

getValue(String)

Gets the value of given column name as a String
Returns: CRMScript.Global.String - Returns a string representation of the wanted value.
Possible values:
  • id
  • title
  • category: the ID
  • ownedBy: (owned_by), the ID of the user who owns the ticket
  • slevel: the security level of the ticket, 1 is internal, 2 is external
  • priority: the id
  • status: 1 = active, 2 = closed, 3 = postponed, 4 = deleted, 5 = composed
  • ticketStatus
  • custId: the ID of the primary customer
  • ticket_type/ticketType: the ID of the request type
  • createdBy: the ID of the user who posted the ticket, 1 if the ticket is posted into the system
  • author
  • activate: the datetime when the ticket was activated
  • createdAt: (created_at), the datetime when the ticket was created
  • closedAt: (closed_at), the datetime when the ticket was closed
  • repliedAt: (replied_at), the datetime when the ticket first was replied at
  • origCategory: the original category
  • origPriority: the original priority
  • isInEscalation
  • displayFilter
  • filterId
  • filterAddress
  • readStatus
  • deadline
  • readByOwner
  • firstReadByUser
  • firstReadByOwner
  • saleId: ID of connected Sale
  • projectId: ID of connected Project

load(Integer)

Load ticket with given id into this object, return true if successful, false otherwise.
Returns: CRMScript.Global.Bool

log(String)

Writes a message to the ticket log. Used for logging changes and events on a ticket
Returns: CRMScript.Global.Void

log(String,String)

Writes a message to the ticket log. Used for logging changes and events on a ticket
Returns: CRMScript.Global.Void

notifyEmail(Integer)

This function sends a notify-email (a replyTemplate) to the owner of the ticket. To use for events like new ticket, new message on ticket etc.
Returns: CRMScript.Global.Bool

save()

Saves the ticket and returns the database ID of the stored ticket.
Returns: CRMScript.Global.Integer - The ID of the saved ticket.

save(String)

Saves the ticket and returns the database ID of the stored ticket.
Returns: CRMScript.Global.Integer - The ID of the saved ticket.

save(Bool,Bool)

Saves the ticket and returns the database ID of the stored ticket.
Returns: CRMScript.Global.Integer - The ID of the saved ticket.

save(String,Bool,Bool)

Saves the ticket and returns the database ID of the stored ticket.
Returns: CRMScript.Global.Integer - The ID of the saved ticket.

sendMessages(String,StringMatrix,Bool,String,Integer,String)

Will send the given messages just like the forward ticket functionality in the GUI. The forwarded messages are separated by a line, and the comment is placed on top of the mail.
Returns: CRMScript.Global.Bool
The recipients string matrix is formatted like this:To | John Doe <john.doe@john.doe> Cc | jane Doe <jane.doe@jane.doe>

setValue(String,String)

Sets column colName to the given value. Obs: For this to actually affect the ticket, you will have to use the function save() after you have set all the values you want.
Returns: CRMScript.Global.Void
Possible values are the extrafields on the ticket and the following:</p>
  • category: the category ID
  • ownedBy: (owned_by), the ID of the user who owns the ticket
  • slevel: the security level of the ticket, See <xref href=“CRMScript.NetServer.TicketSecurityLevel” data-throw-if-not-resolved=“false”></xref>.
  • priority: the id
  • status: 1 = active, 2 = closed, 3 = postponed, 4 = deleted, 5 = composed
  • ticketStatus: (ticket_status), the ID of the custom status field
  • ticket_type/ticketType: the ID of the request type
  • custId: the ID of the primary customer
  • customers: comma-separated list of customer ids
  • createdBy: the ID of the user who posted the ticket, 1 if the ticket is posted into the system
  • author: a string containing the name of the ticket author
  • activate: the datetime when the ticket was activated
  • createdAt: (created_at), the datetime when the ticket was created
  • repliedAt: (replied_at), the datetime when the ticket first was replied at
  • stopEscalation
  • readStatus (read_status)
  • deadline
  • filterAddress
  • timeToClose
  • realTimeToClose
  • dbiAgentId
  • dbiKey
  • dbiLastModified
  • saleId: ID of connected Sale
  • projectId: ID of connected Project

toParser(Parser)

This function will fill the variable space of the Parser with all values of the ticket. As opposed to the function toParserRaw(), the String variables title and author are in html.
Parameters: Returns: CRMScript.Global.Void

toParserRaw(Parser)

This function fills the Parser with the values of the ticket. As opposed to the function toParser() who set several of the String-values as html, all these variables will be in plain text.
Parameters: Returns: CRMScript.Global.Void