Class NSTicketAgent
Agent used for Ticket functions.
Syntax
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSTicketAgent()
Agent used for Ticket functions.
Declaration
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
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
CreateDefaultAttachmentEntity()
Sets default values into a new NSAttachmentEntity.
Declaration
NSAttachmentEntity CreateDefaultAttachmentEntity()
Returns
Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.CreateDefaultAttachmentEntity();
thing = agent.SaveAttachmentEntity(thing);
CreateDefaultTicketEntity()
Sets default values into a new NSTicketEntity.
Declaration
NSTicketEntity CreateDefaultTicketEntity()
Returns
Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.CreateDefaultTicketEntity();
thing = agent.SaveTicketEntity(thing);
CreateDefaultTicketMessageEntity()
Sets default values into a new NSTicketMessageEntity.
Declaration
NSTicketMessageEntity CreateDefaultTicketMessageEntity()
Returns
Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.CreateDefaultTicketMessageEntity();
thing = agent.SaveTicketMessageEntity(thing);
DeleteTicketEntity(Integer)
Declaration
Void DeleteTicketEntity(Integer ticketEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketEntityId |
|
Returns
Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.DeleteTicketEntity(ticketEntityId);
DeleteTicketMessageEntity(Integer)
Declaration
Void DeleteTicketMessageEntity(Integer ticketMessageEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketMessageEntityId |
|
Returns
Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
agent.DeleteTicketMessageEntity(ticketMessageEntityId);
GetAttachmentEntity(Integer)
Gets an NSAttachmentEntity object.
Declaration
NSAttachmentEntity GetAttachmentEntity(Integer attachmentEntityId)
Parameters
Type |
Name |
Description |
Integer |
attachmentEntityId |
|
Returns
Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.GetAttachmentEntity(123);
GetAttachmentInfo(Integer)
Gets a list with meta data for all attached attachments
Declaration
NSAttachmentEntity[] GetAttachmentInfo(Integer ticketMessageEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketMessageEntityId |
|
Returns
Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
NSAttachmentEntity[] res = agent.GetAttachmentInfo(ticketMessageEntityId);
GetAttachmentStream(Integer)
Gets the content of an attachment
Declaration
NSStream GetAttachmentStream(Integer attachmentId)
Parameters
Type |
Name |
Description |
Integer |
attachmentId |
|
Returns
Examples
NSTicketAgent agent;
Integer attachmentId;
NSStream res = agent.GetAttachmentStream(attachmentId);
GetTicket(Integer)
Declaration
NSTicket GetTicket(Integer ticketId)
Parameters
Type |
Name |
Description |
Integer |
ticketId |
|
Returns
Examples
NSTicketAgent agent;
NSTicket thing = agent.GetTicket(123);
GetTicketAttachments(Integer)
Gets attachment infos for all attachments connected to messages in specified ticket
Declaration
NSAttachmentEntity[] GetTicketAttachments(Integer ticketEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketEntityId |
|
Returns
Examples
NSTicketAgent agent;
Integer ticketEntityId;
NSAttachmentEntity[] res = agent.GetTicketAttachments(ticketEntityId);
GetTicketEntity(Integer)
Gets an NSTicketEntity object.
Declaration
NSTicketEntity GetTicketEntity(Integer ticketEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketEntityId |
|
Returns
Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.GetTicketEntity(123);
GetTicketMessage(Integer)
Gets an NSTicketMessage object.
Declaration
NSTicketMessage GetTicketMessage(Integer ticketMessageId)
Parameters
Type |
Name |
Description |
Integer |
ticketMessageId |
|
Returns
Examples
NSTicketAgent agent;
NSTicketMessage thing = agent.GetTicketMessage(123);
GetTicketMessageEntity(Integer)
Gets an NSTicketMessageEntity object.
Declaration
NSTicketMessageEntity GetTicketMessageEntity(Integer ticketMessageEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketMessageEntityId |
|
Returns
Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.GetTicketMessageEntity(123);
GetTickets(Integer[])
Declaration
NSTicket[] GetTickets(Integer[] ticketIds)
Parameters
Type |
Name |
Description |
Integer[] |
ticketIds |
|
Returns
Examples
NSTicketAgent agent;
Integer[] ticketIds;
NSTicket[] res = agent.GetTickets(ticketIds);
Html2Text(String)
Creates a plain text version of the html, suitable for email
Declaration
String Html2Text(String content)
Parameters
Type |
Name |
Description |
String |
content |
|
Returns
Examples
NSTicketAgent agent;
String content;
String res = agent.Html2Text(content);
NotifyNewTicket(Integer)
Notifies user agents about the creation of a new ticket
Declaration
Void NotifyNewTicket(Integer ticketEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketEntityId |
|
Returns
Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.NotifyNewTicket(ticketEntityId);
NotifyNewTicketMessage(Integer)
Notifies user agents about the creation of a new message on a ticket
Declaration
Void NotifyNewTicketMessage(Integer ticketEntityId)
Parameters
Type |
Name |
Description |
Integer |
ticketEntityId |
|
Returns
Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.NotifyNewTicketMessage(ticketEntityId);
SanitizeMailContent(String)
Removes harmful HTML tags and attributes from an email
Declaration
String SanitizeMailContent(String content)
Parameters
Type |
Name |
Description |
String |
content |
|
Returns
Examples
NSTicketAgent agent;
String content;
String res = agent.SanitizeMailContent(content);
SanitizeMailContents(String[])
Removes harmful HTML tags and attributes from an email
Declaration
String[] SanitizeMailContents(String[] contents)
Parameters
Type |
Name |
Description |
String[] |
contents |
|
Returns
Examples
NSTicketAgent agent;
String[] contents;
String[] res = agent.SanitizeMailContents(contents);
SaveAttachmentEntity(NSAttachmentEntity)
Updates the existing NSAttachmentEntity or creates a new NSAttachmentEntity if the id parameter is 0
Declaration
NSAttachmentEntity SaveAttachmentEntity(NSAttachmentEntity attachmentEntity)
Parameters
Returns
Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.CreateDefaultAttachmentEntity();
thing = agent.SaveAttachmentEntity(thing);
SaveTicketEntity(NSTicketEntity)
Updates the existing NSTicketEntity or creates a new NSTicketEntity if the id parameter is 0
Declaration
NSTicketEntity SaveTicketEntity(NSTicketEntity ticketEntity)
Parameters
Type |
Name |
Description |
NSTicketEntity |
ticketEntity |
The NSTicketEntity to save.
|
Returns
Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.CreateDefaultTicketEntity();
thing = agent.SaveTicketEntity(thing);
SaveTicketMessageEntity(NSTicketMessageEntity)
Updates the existing NSTicketMessageEntity or creates a new NSTicketMessageEntity if the id parameter is 0
Declaration
NSTicketMessageEntity SaveTicketMessageEntity(NSTicketMessageEntity ticketMessageEntity)
Parameters
Returns
Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.CreateDefaultTicketMessageEntity();
thing = agent.SaveTicketMessageEntity(thing);
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)
Parameters
Returns
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);
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
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
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)
Parameters
Returns
Examples
NSTicketAgent agent;
Integer ticketEntityId;
Integer readStatus;
Bool checkEscalating;
NSTicketEntity res = agent.SetTicketReadByOwner(ticketEntityId, readStatus, checkEscalating);
UploadAttachment(Integer,NSStream)
Uploads an attachment and returns the attachment ID
Declaration
Integer UploadAttachment(Integer attachmentId, NSStream content)
Parameters
Returns
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);