Show / Hide Table of Contents

Class NSTicketAgent

Agent used for Ticket functions.

Syntax
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
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);

CreateDefaultAttachmentEntity()

Sets default values into a new NSAttachmentEntity.

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.

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.

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

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

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.

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

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

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.

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

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.

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.

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.

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

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

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

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

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

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

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

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

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

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

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

Declaration
Void SetTicketMessageImportant(Integer ticketMessageId, Bool important)
Parameters
Type Name Description
Integer ticketMessageId
Bool important
Returns
Type Description
Void
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
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

Declaration
Integer UploadAttachment(Integer attachmentId, NSStream content)
Parameters
Type Name Description
Integer attachmentId
NSStream content
Returns
Type Description
Integer
Examples
NSTicketAgent agent;
agent.callMethod(arg1, arg2);
In This Article
  • Constructors
    • NSTicketAgent()
  • Methods
    • AddAttachments(Integer,Integer[])
    • CreateDefaultAttachmentEntity()
    • CreateDefaultTicketEntity()
    • CreateDefaultTicketMessageEntity()
    • DeleteTicketEntity(Integer)
    • DeleteTicketMessageEntity(Integer)
    • GetAttachmentEntity(Integer)
    • GetAttachmentInfo(Integer)
    • GetAttachmentStream(Integer)
    • GetTicket(Integer)
    • GetTicketAttachments(Integer)
    • GetTicketEntity(Integer)
    • GetTicketMessage(Integer)
    • GetTicketMessageEntity(Integer)
    • GetTickets(Integer[])
    • Html2Text(String)
    • NotifyNewTicket(Integer)
    • NotifyNewTicketMessage(Integer)
    • SanitizeMailContent(String)
    • SanitizeMailContents(String[])
    • SaveAttachmentEntity(NSAttachmentEntity)
    • SaveTicketEntity(NSTicketEntity)
    • SaveTicketMessageEntity(NSTicketMessageEntity)
    • SendTicketMessage(Integer,String[],String[],String[],String,Integer,String)
    • SetTicketMessageImportant(Integer,Bool)
    • SetTicketReadByOwner(Integer,Integer,Bool)
    • UploadAttachment(Integer,NSStream)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top