Class NSTicketAgent
Agent used for Ticket functions.
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSTicketAgent()
Agent used for Ticket functions.
Declaration
NSTicketAgent Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
Methods
AddAttachments(Integer,Integer[])
Connects existing attachments with this TicketMessage. Can connect multiple attachments
Declaration
Void AddAttachments(Integer ticketMessageEntityId, Integer[] attachmentIds) Parameters
| Type | Name | Description |
| Integer | ticketMessageEntityId | |
| Integer[] | attachmentIds |
Returns
| Type | Description |
| Void |
CreateDefaultAttachmentEntity()
Sets default values into a new NSAttachmentEntity.
Declaration
NSAttachmentEntity CreateDefaultAttachmentEntity() Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.CreateDefaultAttachmentEntity();
thing = agent.SaveAttachmentEntity(thing);
Returns
| Type | Description |
| NSAttachmentEntity |
CreateDefaultTicketEntity()
Sets default values into a new NSTicketEntity.
Declaration
NSTicketEntity CreateDefaultTicketEntity() Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.CreateDefaultTicketEntity();
thing = agent.SaveTicketEntity(thing);
Returns
| Type | Description |
| NSTicketEntity |
CreateDefaultTicketMessageEntity()
Sets default values into a new NSTicketMessageEntity.
Declaration
NSTicketMessageEntity CreateDefaultTicketMessageEntity() Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.CreateDefaultTicketMessageEntity();
thing = agent.SaveTicketMessageEntity(thing);
Returns
| Type | Description |
| NSTicketMessageEntity |
DeleteTicketEntity(Integer)
Deletes a ticket
Declaration
Void DeleteTicketEntity(Integer ticketEntityId) Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.DeleteTicketEntity(ticketEntityId);
Parameters
| Type | Name | Description |
| Integer | ticketEntityId |
Returns
| Type | Description |
| Void |
DeleteTicketMessageEntity(Integer)
Deletes a ticket message
Declaration
Void DeleteTicketMessageEntity(Integer ticketMessageEntityId) Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
agent.DeleteTicketMessageEntity(ticketMessageEntityId);
Parameters
| Type | Name | Description |
| Integer | ticketMessageEntityId |
Returns
| Type | Description |
| Void |
GetAttachmentEntity(Integer)
Gets an NSAttachmentEntity object.
Declaration
NSAttachmentEntity GetAttachmentEntity(Integer attachmentEntityId) Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.GetAttachmentEntity(123);
Parameters
| Type | Name | Description |
| Integer | attachmentEntityId |
Returns
| Type | Description |
| NSAttachmentEntity |
GetAttachmentInfo(Integer)
Gets a list with meta data for all attached attachments
Declaration
NSAttachmentEntity[] GetAttachmentInfo(Integer ticketMessageEntityId) Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
NSAttachmentEntity[] res = agent.GetAttachmentInfo(ticketMessageEntityId);
Parameters
| Type | Name | Description |
| Integer | ticketMessageEntityId |
Returns
| Type | Description |
| NSAttachmentEntity[] |
GetAttachmentStream(Integer)
Gets the content of an attachment
Declaration
NSStream GetAttachmentStream(Integer attachmentId) Examples
NSTicketAgent agent;
Integer attachmentId;
NSStream res = agent.GetAttachmentStream(attachmentId);
Parameters
| Type | Name | Description |
| Integer | attachmentId |
Returns
| Type | Description |
| NSStream |
GetTicket(Integer)
Gets an NSTicket object.
Declaration
NSTicket GetTicket(Integer ticketId) Examples
NSTicketAgent agent;
NSTicket thing = agent.GetTicket(123);
Parameters
| Type | Name | Description |
| Integer | ticketId |
Returns
| Type | Description |
| Ticket |
GetTicketAttachments(Integer)
Gets attachment infos for all attachments connected to messages in specified ticket
Declaration
NSAttachmentEntity[] GetTicketAttachments(Integer ticketEntityId) Examples
NSTicketAgent agent;
Integer ticketEntityId;
NSAttachmentEntity[] res = agent.GetTicketAttachments(ticketEntityId);
Parameters
| Type | Name | Description |
| Integer | ticketEntityId |
Returns
| Type | Description |
| NSAttachmentEntity[] |
GetTicketEntity(Integer)
Gets an NSTicketEntity object.
Declaration
NSTicketEntity GetTicketEntity(Integer ticketEntityId) Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.GetTicketEntity(123);
Parameters
| Type | Name | Description |
| Integer | ticketEntityId |
Returns
| Type | Description |
| NSTicketEntity |
GetTicketMessage(Integer)
Gets an NSTicketMessage object.
Declaration
NSTicketMessage GetTicketMessage(Integer ticketMessageId) Examples
NSTicketAgent agent;
NSTicketMessage thing = agent.GetTicketMessage(123);
Parameters
| Type | Name | Description |
| Integer | ticketMessageId |
Returns
| Type | Description |
| NSTicketMessage |
GetTicketMessageEntity(Integer)
Gets an NSTicketMessageEntity object.
Declaration
NSTicketMessageEntity GetTicketMessageEntity(Integer ticketMessageEntityId) Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.GetTicketMessageEntity(123);
Parameters
| Type | Name | Description |
| Integer | ticketMessageEntityId |
Returns
| Type | Description |
| NSTicketMessageEntity |
GetTickets(Integer[])
Gets multiple tickets
Declaration
NSTicket[] GetTickets(Integer[] ticketIds) Examples
NSTicketAgent agent;
Integer[] ticketIds;
NSTicket[] res = agent.GetTickets(ticketIds);
Parameters
| Type | Name | Description |
| Integer[] | ticketIds |
Returns
| Type | Description |
| NSTicket[] |
Html2Text(String)
Creates a plain text version of the html, suitable for email
Declaration
String Html2Text(String content) Examples
NSTicketAgent agent;
String content;
String res = agent.Html2Text(content);
Parameters
| Type | Name | Description |
| String | content |
Returns
| Type | Description |
| String |
NotifyNewTicket(Integer)
Notifies user agents about the creation of a new ticket
Declaration
Void NotifyNewTicket(Integer ticketEntityId) Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.NotifyNewTicket(ticketEntityId);
Parameters
| Type | Name | Description |
| Integer | ticketEntityId |
Returns
| Type | Description |
| Void |
NotifyNewTicketMessage(Integer)
Notifies user agents about the creation of a new message on a ticket
Declaration
Void NotifyNewTicketMessage(Integer ticketEntityId) Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.NotifyNewTicketMessage(ticketEntityId);
Parameters
| Type | Name | Description |
| Integer | ticketEntityId |
Returns
| Type | Description |
| Void |
SanitizeMailContent(String)
Removes harmful HTML tags and attributes from an email
Declaration
String SanitizeMailContent(String content) Examples
NSTicketAgent agent;
String content;
String res = agent.SanitizeMailContent(content);
Parameters
| Type | Name | Description |
| String | content |
Returns
| Type | Description |
| String |
SanitizeMailContents(String[])
Removes harmful HTML tags and attributes from an email
Declaration
String[] SanitizeMailContents(String[] contents) Examples
NSTicketAgent agent;
String[] contents;
String[] res = agent.SanitizeMailContents(contents);
Parameters
| Type | Name | Description |
| String[] | contents |
Returns
| Type | Description |
| String[] |
SaveAttachmentEntity(NSAttachmentEntity)
Updates the existing NSAttachmentEntity or creates a new NSAttachmentEntity if the id parameter is 0
Declaration
NSAttachmentEntity SaveAttachmentEntity(NSAttachmentEntity attachmentEntity) Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.CreateDefaultAttachmentEntity();
thing = agent.SaveAttachmentEntity(thing);
Parameters
| Type | Name | Description |
| NSAttachmentEntity | attachmentEntity | The NSAttachmentEntity to save. |
Returns
| Type | Description |
| NSAttachmentEntity |
SaveTicketEntity(NSTicketEntity)
Updates the existing NSTicketEntity or creates a new NSTicketEntity if the id parameter is 0
Declaration
NSTicketEntity SaveTicketEntity(NSTicketEntity ticketEntity) Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.CreateDefaultTicketEntity();
thing = agent.SaveTicketEntity(thing);
Parameters
| Type | Name | Description |
| NSTicketEntity | ticketEntity | The NSTicketEntity to save. |
Returns
| Type | Description |
| NSTicketEntity |
SaveTicketMessageEntity(NSTicketMessageEntity)
Updates the existing NSTicketMessageEntity or creates a new NSTicketMessageEntity if the id parameter is 0
Declaration
NSTicketMessageEntity SaveTicketMessageEntity(NSTicketMessageEntity ticketMessageEntity) Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.CreateDefaultTicketMessageEntity();
thing = agent.SaveTicketMessageEntity(thing);
Parameters
| Type | Name | Description |
| NSTicketMessageEntity | ticketMessageEntity | The NSTicketMessageEntity to save. |
Returns
| Type | Description |
| NSTicketMessageEntity |
SendTicketMessage(Integer,String[],String[],String[],String,Integer,String)
Sends a message to recipients, e.g. by email or sms
Declaration
Void SendTicketMessage(Integer ticketMessageEntityId, String[] to, String[] cc, String[] bcc, String subject, Integer replyTemplateId, String gdprSource) Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
String[] to;
String[] cc;
String[] bcc;
String subject;
Integer replyTemplateId;
String gdprSource;
agent.SendTicketMessage(ticketMessageEntityId, to, cc, bcc, subject, replyTemplateId, gdprSource);
Parameters
| Type | Name | Description |
| Integer | ticketMessageEntityId | |
| String[] | to | |
| String[] | cc | |
| String[] | bcc | |
| String | subject | |
| Integer | replyTemplateId | |
| String | gdprSource |
Returns
| Type | Description |
| Void |
SetTicketMessageImportant(Integer,Bool)
Sets the important flag on or off for a ticket message
Declaration
Void SetTicketMessageImportant(Integer ticketMessageId, Bool important) Parameters
| Type | Name | Description |
| Integer | ticketMessageId | |
| Bool | important |
Returns
| Type | Description |
| Void |
SetTicketReadByOwner(Integer,Integer,Bool)
Sets the ReadByOwner status for a ticket. It will only have an effect if the calling user is the same as the owner of the ticket
Declaration
NSTicketEntity SetTicketReadByOwner(Integer ticketEntityId, Integer readStatus, Bool checkEscalating) Examples
NSTicketAgent agent;
Integer ticketEntityId;
Integer readStatus;
Bool checkEscalating;
NSTicketEntity res = agent.SetTicketReadByOwner(ticketEntityId, readStatus, checkEscalating);
Parameters
| Type | Name | Description |
| Integer | ticketEntityId | |
| Integer | readStatus | See <xref href="CRMScript.NetServer.TicketReadStatus" data-throw-if-not-resolved="false"></xref>. |
| Bool | checkEscalating |
Returns
| Type | Description |
| NSTicketEntity |