Show / Hide Table of Contents

Class NSTicketMessageEntity

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Syntax

Constructors

NSTicketMessageEntity()

Initializes a new instance of the NSTicketMessageEntity class.

Declaration
NSTicketMessageEntity

Methods

GetAuthor()

A string representing the author of the message. Could be a user's name, or a persons email address.

Declaration
String GetAuthor()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String author = thing.GetAuthor();

GetBody()

The textbody for the message.

Declaration
String GetBody()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String body = thing.GetBody();

GetCreatedAt()

When the message was posted.

Declaration
DateTime GetCreatedAt()
Returns
Type Description
DateTime
Examples
NSTicketMessageEntity thing;
DateTime createdAt = thing.GetCreatedAt();

GetCreatedBy()

The associate who created this ticket message

Declaration
NSAssociate GetCreatedBy()
Returns
Type Description
NSAssociate
Examples
NSTicketMessageEntity thing;
NSAssociate createdBy = thing.GetCreatedBy();

GetCustomFields()

Gets the user-defined + extra fields on a TicketMessageEntity as a map.

Declaration
Map GetCustomFields()
Returns
Type Description
Map
Examples
NSTicketMessageEntity thing;
Map fields = thing.GetCustomFields();
String oldValue = fields.get("SuperOffice:1");
fields.insert("SuperOffice:1", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());

GetDebugInfo()

The debug info for the message.

Declaration
String GetDebugInfo()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String debugInfo = thing.GetDebugInfo();

GetEjMessageId()

The primary key (auto-incremented)

Declaration
Integer GetEjMessageId()
Returns
Type Description
Integer
Examples
NSTicketMessageEntity thing;
Integer ejMessageId = thing.GetEjMessageId();

GetEmailHeader()

The email header is saved in this field as raw text

Declaration
String GetEmailHeader()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String emailHeader = thing.GetEmailHeader();

GetExtraFields()

Gets the extra fields on TicketMessageEntity as a map.

Declaration
Map GetExtraFields()
Returns
Type Description
Map
Examples
NSTicketMessageEntity thing;
Map fields = thing.GetExtraFields();
String oldValue = fields.get("x_foobar");
fields.insert("x_foobar", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());

GetHtmlBody()

The HTML body for the message (if any).

Declaration
String GetHtmlBody()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String htmlBody = thing.GetHtmlBody();

GetImportant()

If this message is important or not.

Declaration
Bool GetImportant()
Returns
Type Description
Bool
Examples
NSTicketMessageEntity thing;
Bool important = thing.GetImportant();

GetMailSorter()

The name of the mail sorter used when the email was imported. Note: We must use name instead of id since the id's change every time one changes the mail sorter. :-0

Declaration
String GetMailSorter()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String mailSorter = thing.GetMailSorter();

GetMessageCategory()

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Integer GetMessageCategory()
Returns
Type Description
Integer

Defines what kind of message this is. See TicketMessageCategory.

Examples
NSTicketMessageEntity thing;
Integer messageCategory = thing.GetMessageCategory();

GetMessageHeaders()

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
NSTicketMessageHeader[] GetMessageHeaders()
Returns
Type Description
NSTicketMessageHeader[]

Contains the message headers, like To, Cc, Bcc information, or custom headers.

Examples
NSTicketMessageEntity thing;
TicketMessageHeader[] messageHeaders = thing.GetMessageHeaders();

GetMessageId()

The X-Message-Id header value from the email. Used for threading, i.e. connecting messages to existing tickets.

Declaration
String GetMessageId()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String messageId = thing.GetMessageId();

GetPerson()

If this is an incoming message, this will contain the person

Declaration
NSPerson GetPerson()
Returns
Type Description
NSPerson
Examples
NSTicketMessageEntity thing;
NSPerson person = thing.GetPerson();

GetSearchTitle()

A copy of the title of the ticket, for search optimization and simpler reporting.

Declaration
String GetSearchTitle()
Returns
Type Description
String
Examples
NSTicketMessageEntity thing;
String searchTitle = thing.GetSearchTitle();

GetSlevel()

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Integer GetSlevel()
Returns
Type Description
Integer

The security level of the message. See TicketSecurityLevel.

Examples
NSTicketMessageEntity thing;
Integer slevel = thing.GetSlevel();

GetTicket()

The connected ticket

Declaration
NSTicket GetTicket()
Returns
Type Description
NSTicket
Examples
NSTicketMessageEntity thing;
NSTicket ticket = thing.GetTicket();

GetTimeSpent()

The time spent (minutes) for this message.

Declaration
Integer GetTimeSpent()
Returns
Type Description
Integer
Examples
NSTicketMessageEntity thing;
Integer timeSpent = thing.GetTimeSpent();

GetType()

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Integer GetType()
Returns
Type Description
Integer

The type of the message (plaintext/html). See TicketMessageType.

Examples
NSTicketMessageEntity thing;
Integer type = thing.GetType();

SetAuthor(String)

A string representing the author of the message. Could be a user's name, or a persons email address.

Declaration
Void SetAuthor(String author)
Parameters
Type Name Description
String author
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String author;
thing.SetAuthor(author);

SetBody(String)

The textbody for the message.

Declaration
Void SetBody(String body)
Parameters
Type Name Description
String body
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String body;
thing.SetBody(body);

SetCreatedAt(DateTime)

When the message was posted.

Declaration
Void SetCreatedAt(DateTime createdAt)
Examples
NSTicketMessageEntity thing;
DateTime createdAt;
thing.SetCreatedAt(createdAt);

SetCreatedBy(NSAssociate)

The associate who created this ticket message

Declaration
Void SetCreatedBy(NSAssociate createdBy)
Examples
NSTicketMessageEntity thing;
NSAssociate createdBy;
thing.SetCreatedBy(createdBy);

SetCustomFields(Map)

Sets the user-defined and extra fields on a TicketMessageEntity with a map.

Declaration
Void SetCustomFields(Map udefs)
Parameters
Type Name Description
Map udefs
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
Map udefs;
udefs["SuperOffice:1"] = "[I:123]";
udefs["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
udefs["custom.progid"] = "foobar";
udefs["x_foo"] = "foobar";
udefs["x_bar"] = "456"; // List item id
thing.SetCustomFields(udefs);

SetDebugInfo(String)

The debug info for the message.

Declaration
Void SetDebugInfo(String debugInfo)
Parameters
Type Name Description
String debugInfo
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String debugInfo;
thing.SetDebugInfo(debugInfo);

SetEjMessageId(Integer)

The primary key (auto-incremented)

Declaration
Void SetEjMessageId(Integer ejMessageId)
Parameters
Type Name Description
Integer ejMessageId
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
Integer ejMessageId;
thing.SetEjMessageId(ejMessageId);

SetEmailHeader(String)

The email header is saved in this field as raw text

Declaration
Void SetEmailHeader(String emailHeader)
Parameters
Type Name Description
String emailHeader
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String emailHeader;
thing.SetEmailHeader(emailHeader);

SetExtraFields(Map)

Sets the extra field values on TicketMessageEntity with a map.

Declaration
Void SetExtraFields(Map extras)
Parameters
Type Name Description
Map extras
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
Map extras;
extras["SuperOffice:1"] = "[I:123]";
extras["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
extras["custom.progid"] = "foobar";
thing.SetExtraFields(extras);

SetHtmlBody(String)

The HTML body for the message (if any).

Declaration
Void SetHtmlBody(String htmlBody)
Parameters
Type Name Description
String htmlBody
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String htmlBody;
thing.SetHtmlBody(htmlBody);

SetImportant(Bool)

If this message is important or not.

Declaration
Void SetImportant(Bool important)
Parameters
Type Name Description
Bool important
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
Bool important;
thing.SetImportant(important);

SetMailSorter(String)

The name of the mail sorter used when the email was imported. Note: We must use name instead of id since the id's change every time one changes the mail sorter. :-0

Declaration
Void SetMailSorter(String mailSorter)
Parameters
Type Name Description
String mailSorter
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String mailSorter;
thing.SetMailSorter(mailSorter);

SetMessageCategory(Integer)

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Void SetMessageCategory(Integer messageCategory)
Parameters
Type Name Description
Integer messageCategory

Defines what kind of message this is. See TicketMessageCategory.

Examples
NSTicketMessageEntity thing;
Integer messageCategory;
thing.SetMessageCategory(messageCategory);

SetMessageHeaders(NSTicketMessageHeader[])

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Void SetMessageHeaders(NSTicketMessageHeader[] messageHeaders)
Parameters
Type Name Description
NSTicketMessageHeader[] messageHeaders

Contains the message headers, like To, Cc, Bcc information, or custom headers.

Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
NSTicketMessageHeader[] messageHeaders;
thing.SetMessageHeaders(messageHeaders);

SetMessageId(String)

The X-Message-Id header value from the email. Used for threading, i.e. connecting messages to existing tickets.

Declaration
Void SetMessageId(String messageId)
Parameters
Type Name Description
String messageId
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String messageId;
thing.SetMessageId(messageId);

SetPerson(NSPerson)

If this is an incoming message, this will contain the person

Declaration
Void SetPerson(NSPerson person)
Parameters
Type Name Description
NSPerson person
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
NSPerson person;
thing.SetPerson(person);

SetSearchTitle(String)

A copy of the title of the ticket, for search optimisation and simpler reporting.

Declaration
Void SetSearchTitle(String searchTitle)
Parameters
Type Name Description
String searchTitle
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
String searchTitle;
thing.SetSearchTitle(searchTitle);

SetSlevel(Integer)

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Void SetSlevel(Integer slevel)
Parameters
Type Name Description
Integer slevel

The security level of the message. See TicketSecurityLevel.

Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
Integer slevel;
thing.SetSlevel(slevel);

SetTicket(NSTicket)

The connected ticket

Declaration
Void SetTicket(NSTicket ticket)
Parameters
Type Name Description
NSTicket ticket
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
NSTicket ticket;
thing.SetTicket(ticket);

SetTimeSpent(Integer)

The time spent (minutes) for this message.

Declaration
Void SetTimeSpent(Integer timeSpent)
Parameters
Type Name Description
Integer timeSpent
Returns
Type Description
Void
Examples
NSTicketMessageEntity thing;
Integer timeSpent;
thing.SetTimeSpent(timeSpent);

SetType(Integer)

The ticket messages are e-mails, SMS or other messages attached to a ticket (aka request).

Declaration
Void SetType(Integer type)
Parameters
Type Name Description
Integer type

The type of the message (plaintext/html). See TicketMessageType.

Examples
NSTicketMessageEntity thing;
Integer type;
thing.SetType(type);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top