Class NSTicketAgent
Agent used for Ticket functions.
Syntax
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSTicketAgent()
Agent used for Ticket functions.
Introduced or updated in version: 8.5R08
Declaration
NSTicketAgent
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
Methods
AddAttachments(Integer,Integer[])
Connects existing attachments with this TicketMessage. Can connect multiple attachments
Introduced or updated in version: 8.5R08
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.
Introduced or updated in version: 8.5R08
Declaration
NSAttachmentEntity CreateDefaultAttachmentEntity()
Returns
Type | Description |
---|---|
NSAttachmentEntity |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.CreateDefaultAttachmentEntity();
thing = agent.SaveAttachmentEntity(thing);
CreateDefaultTicketEntity()
Sets default values into a new NSTicketEntity.
Introduced or updated in version: 8.5R08
Declaration
NSTicketEntity CreateDefaultTicketEntity()
Returns
Type | Description |
---|---|
NSTicketEntity |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.CreateDefaultTicketEntity();
thing = agent.SaveTicketEntity(thing);
CreateDefaultTicketMessageEntity()
Sets default values into a new NSTicketMessageEntity.
Introduced or updated in version: 8.5R08
Declaration
NSTicketMessageEntity CreateDefaultTicketMessageEntity()
Returns
Type | Description |
---|---|
NSTicketMessageEntity |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.CreateDefaultTicketMessageEntity();
thing = agent.SaveTicketMessageEntity(thing);
DeleteTicketEntity(Integer)
Deletes a ticket
Introduced or updated in version: 8.5R08
Declaration
Void DeleteTicketEntity(Integer ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketEntityId |
Returns
Type | Description |
---|---|
Void |
Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.DeleteTicketEntity(ticketEntityId);
DeleteTicketMessageEntity(Integer)
Deletes a ticket message
Introduced or updated in version: 8.5R08
Declaration
Void DeleteTicketMessageEntity(Integer ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketMessageEntityId |
Returns
Type | Description |
---|---|
Void |
Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
agent.DeleteTicketMessageEntity(ticketMessageEntityId);
GetAttachmentEntity(Integer)
Gets an NSAttachmentEntity object.
Introduced or updated in version: 8.5R08
Declaration
NSAttachmentEntity GetAttachmentEntity(Integer attachmentEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | attachmentEntityId |
Returns
Type | Description |
---|---|
NSAttachmentEntity |
Examples
NSTicketAgent agent;
NSAttachmentEntity thing = agent.GetAttachmentEntity(123);
GetAttachmentInfo(Integer)
Gets a list with meta data for all attached attachments
Introduced or updated in version: 8.5R08
Declaration
NSAttachmentEntity[] GetAttachmentInfo(Integer ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketMessageEntityId |
Returns
Type | Description |
---|---|
NSAttachmentEntity[] |
Examples
NSTicketAgent agent;
Integer ticketMessageEntityId;
NSAttachmentEntity[] res = agent.GetAttachmentInfo(ticketMessageEntityId);
GetAttachmentStream(Integer)
Gets the content of an attachment
Introduced or updated in version: 8.5R08
Declaration
NSStream GetAttachmentStream(Integer attachmentId)
Parameters
Type | Name | Description |
---|---|---|
Integer | attachmentId |
Returns
Type | Description |
---|---|
NSStream |
Examples
NSTicketAgent agent;
Integer attachmentId;
NSStream res = agent.GetAttachmentStream(attachmentId);
GetTicket(Integer)
Gets an NSTicket object.
Introduced or updated in version: 8.5R08
Declaration
NSTicket GetTicket(Integer ticketId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketId |
Returns
Type | Description |
---|---|
Ticket |
Examples
NSTicketAgent agent;
NSTicket thing = agent.GetTicket(123);
GetTicketAttachments(Integer)
Gets attachment infos for all attachments connected to messages in specified ticket
Introduced or updated in version: 8.5R08
Declaration
NSAttachmentEntity[] GetTicketAttachments(Integer ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketEntityId |
Returns
Type | Description |
---|---|
NSAttachmentEntity[] |
Examples
NSTicketAgent agent;
Integer ticketEntityId;
NSAttachmentEntity[] res = agent.GetTicketAttachments(ticketEntityId);
GetTicketEntity(Integer)
Gets an NSTicketEntity object.
Introduced or updated in version: 8.5R08
Declaration
NSTicketEntity GetTicketEntity(Integer ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketEntityId |
Returns
Type | Description |
---|---|
NSTicketEntity |
Examples
NSTicketAgent agent;
NSTicketEntity thing = agent.GetTicketEntity(123);
GetTicketMessage(Integer)
Gets an NSTicketMessage object.
Introduced or updated in version: 8.5R08
Declaration
NSTicketMessage GetTicketMessage(Integer ticketMessageId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketMessageId |
Returns
Type | Description |
---|---|
NSTicketMessage |
Examples
NSTicketAgent agent;
NSTicketMessage thing = agent.GetTicketMessage(123);
GetTicketMessageEntity(Integer)
Gets an NSTicketMessageEntity object.
Introduced or updated in version: 8.5R08
Declaration
NSTicketMessageEntity GetTicketMessageEntity(Integer ticketMessageEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketMessageEntityId |
Returns
Type | Description |
---|---|
NSTicketMessageEntity |
Examples
NSTicketAgent agent;
NSTicketMessageEntity thing = agent.GetTicketMessageEntity(123);
GetTickets(Integer[])
Gets multiple tickets
Introduced or updated in version: 8.5R08
Declaration
NSTicket[] GetTickets(Integer[] ticketIds)
Parameters
Type | Name | Description |
---|---|---|
Integer[] | ticketIds |
Returns
Type | Description |
---|---|
NSTicket[] |
Examples
NSTicketAgent agent;
Integer[] ticketIds;
NSTicket[] res = agent.GetTickets(ticketIds);
Html2Text(String)
Creates a plain text version of the html, suitable for email
Introduced or updated in version: 8.5R08
Declaration
String Html2Text(String content)
Parameters
Type | Name | Description |
---|---|---|
String | content |
Returns
Type | Description |
---|---|
String |
Examples
NSTicketAgent agent;
String content;
String res = agent.Html2Text(content);
NotifyNewTicket(Integer)
Notifies user agents about the creation of a new ticket
Introduced or updated in version: 8.5R08
Declaration
Void NotifyNewTicket(Integer ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketEntityId |
Returns
Type | Description |
---|---|
Void |
Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.NotifyNewTicket(ticketEntityId);
NotifyNewTicketMessage(Integer)
Notifies user agents about the creation of a new message on a ticket
Introduced or updated in version: 8.5R08
Declaration
Void NotifyNewTicketMessage(Integer ticketEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketEntityId |
Returns
Type | Description |
---|---|
Void |
Examples
NSTicketAgent agent;
Integer ticketEntityId;
agent.NotifyNewTicketMessage(ticketEntityId);
SanitizeMailContent(String)
Removes harmful HTML tags and attributes from an email
Introduced or updated in version: 8.5R08
Declaration
String SanitizeMailContent(String content)
Parameters
Type | Name | Description |
---|---|---|
String | content |
Returns
Type | Description |
---|---|
String |
Examples
NSTicketAgent agent;
String content;
String res = agent.SanitizeMailContent(content);
SanitizeMailContents(String[])
Removes harmful HTML tags and attributes from an email
Introduced or updated in version: 8.5R08
Declaration
String[] SanitizeMailContents(String[] contents)
Parameters
Type | Name | Description |
---|---|---|
String[] | contents |
Returns
Type | Description |
---|---|
String[] |
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
Introduced or updated in version: 8.5R08
Declaration
NSAttachmentEntity SaveAttachmentEntity(NSAttachmentEntity attachmentEntity)
Parameters
Type | Name | Description |
---|---|---|
NSAttachmentEntity | attachmentEntity | The NSAttachmentEntity to save. |
Returns
Type | Description |
---|---|
NSAttachmentEntity |
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
Introduced or updated in version: 8.5R08
Declaration
NSTicketEntity SaveTicketEntity(NSTicketEntity ticketEntity)
Parameters
Type | Name | Description |
---|---|---|
NSTicketEntity | ticketEntity | The NSTicketEntity to save. |
Returns
Type | Description |
---|---|
NSTicketEntity |
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
Introduced or updated in version: 8.5R08
Declaration
NSTicketMessageEntity SaveTicketMessageEntity(NSTicketMessageEntity ticketMessageEntity)
Parameters
Type | Name | Description |
---|---|---|
NSTicketMessageEntity | ticketMessageEntity | The NSTicketMessageEntity to save. |
Returns
Type | Description |
---|---|
NSTicketMessageEntity |
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
Introduced or updated in version: 8.5R08
Declaration
Void SendTicketMessage(Integer ticketMessageEntityId, String[] to, String[] cc, String[] bcc, String subject, Integer replyTemplateId, String gdprSource)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketMessageEntityId | |
String[] | to | |
String[] | cc | |
String[] | bcc | |
String | subject | |
Integer | replyTemplateId | |
String | gdprSource |
Returns
Type | Description |
---|---|
Void |
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
Introduced or updated in version: 8.5R08
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
Introduced or updated in version: 8.5R08
Declaration
NSTicketEntity SetTicketReadByOwner(Integer ticketEntityId, Integer readStatus, Bool checkEscalating)
Parameters
Type | Name | Description |
---|---|---|
Integer | ticketEntityId | |
Integer | readStatus | See TicketReadStatus. |
Bool | checkEscalating |
Returns
Type | Description |
---|---|
NSTicketEntity |
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
Introduced or updated in version: 8.5R08
Declaration
Integer UploadAttachment(Integer attachmentId, NSStream content)
Parameters
Type | Name | Description |
---|---|---|
Integer | attachmentId | |
NSStream | content |
Returns
Type | Description |
---|---|
Integer |