Constructors
Ticket()
Methods
buildEmailSubject()
returns a String composed by the Mail tag, the ticketId and the title of the ticketcheckEscalating(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.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>.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>.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.getMailFrom()
This function determines and returns the most appropriate from-address, when sending a mail-message on a ticket.getOwnerEmail()
This function returns the owner of the ticket printed as “Name” <email-addr>.getOwnerSms()
This function returns the cellphone number of the owner of the ticketgetValue(String)
Gets the value of given column name as a StringPossible 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.log(String)
Writes a message to the ticket log. Used for logging changes and events on a ticketlog(String,String)
Writes a message to the ticket log. Used for logging changes and events on a ticketnotifyEmail(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.save()
Saves the ticket and returns the database ID of the stored ticket.save(String)
Saves the ticket and returns the database ID of the stored ticket.save(Bool,Bool)
Saves the ticket and returns the database ID of the stored ticket.save(String,Bool,Bool)
Saves the ticket and returns the database ID of the stored 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.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.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.
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.
Returns: CRMScript.Global.Void