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
Methods
GetAuthor()
A string representing the author of the message. Could be a user's name, or a persons email address.
Declaration
Returns
Examples
NSTicketMessageEntity thing;
String author = thing.GetAuthor();
GetBody()
The textbody for the message.
Declaration
Returns
Examples
NSTicketMessageEntity thing;
String body = thing.GetBody();
GetCreatedAt()
When the message was posted.
Declaration
Returns
Examples
NSTicketMessageEntity thing;
DateTime createdAt = thing.GetCreatedAt();
GetCreatedBy()
The associate who created this ticket message
Declaration
NSAssociate GetCreatedBy()
Returns
Examples
NSTicketMessageEntity thing;
NSAssociate createdBy = thing.GetCreatedBy();
GetCustomFields()
Gets the user-defined + extra fields on a TicketMessageEntity as a map.
Declaration
Returns
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
Returns
Examples
NSTicketMessageEntity thing;
String debugInfo = thing.GetDebugInfo();
GetEjMessageId()
The primary key (auto-incremented)
Declaration
Returns
Examples
NSTicketMessageEntity thing;
Integer ejMessageId = thing.GetEjMessageId();
The email header is saved in this field as raw text
Declaration
Returns
NSTicketMessageEntity thing;
String emailHeader = thing.GetEmailHeader();
Gets the extra fields on TicketMessageEntity as a map.
Declaration
Returns
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
Returns
Examples
NSTicketMessageEntity thing;
String htmlBody = thing.GetHtmlBody();
GetImportant()
If this message is important or not.
Declaration
Returns
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
Returns
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
Examples
NSTicketMessageEntity thing;
Integer messageCategory = thing.GetMessageCategory();
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.
|
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
Returns
Examples
NSTicketMessageEntity thing;
String messageId = thing.GetMessageId();
GetPerson()
If this is an incoming message, this will contain the person
Declaration
Returns
Examples
NSTicketMessageEntity thing;
NSPerson person = thing.GetPerson();
GetSearchTitle()
A copy of the title of the ticket, for search optimization and simpler reporting.
Declaration
Returns
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
Returns
Examples
NSTicketMessageEntity thing;
Integer slevel = thing.GetSlevel();
GetTicket()
Declaration
Returns
Examples
NSTicketMessageEntity thing;
NSTicket ticket = thing.GetTicket();
GetTimeSpent()
The time spent (minutes) for this message.
Declaration
Returns
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
Returns
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
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
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
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
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
Examples
NSTicketMessageEntity thing;
Integer ejMessageId;
thing.SetEjMessageId(ejMessageId);
The email header is saved in this field as raw text
Declaration
Void SetEmailHeader(String emailHeader)
Parameters
Type |
Name |
Description |
String |
emailHeader |
|
Returns
NSTicketMessageEntity thing;
String emailHeader;
thing.SetEmailHeader(emailHeader);
Sets the extra field values on TicketMessageEntity with a map.
Declaration
Void SetExtraFields(Map extras)
Parameters
Type |
Name |
Description |
Map |
extras |
|
Returns
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
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
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
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
Examples
NSTicketMessageEntity thing;
Integer messageCategory;
thing.SetMessageCategory(messageCategory);
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
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
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
Returns
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
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
Returns
Examples
NSTicketMessageEntity thing;
Integer slevel;
thing.SetSlevel(slevel);
SetTicket(NSTicket)
Declaration
Void SetTicket(NSTicket ticket)
Parameters
Returns
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
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
Examples
NSTicketMessageEntity thing;
Integer type;
thing.SetType(type);