> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSTicketMessage

> The TicketMessage carrier is used for representing a service ticket message.

The TicketMessage carrier is used for representing a service ticket message.

## Constructors

### NSTicketMessage()

```crmscript theme={null}
NSTicketMessage
```

Initializes a new instance of the NSTicketMessage class.

## Methods

## GetAuthor()

```crmscript theme={null}
String GetAuthor()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - A string representing the author of the message. Could be a user's name, or a persons email address.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String author = thing.GetAuthor();
```

## GetContactDepartment()

\\

```crmscript theme={null}
String GetContactDepartment()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - nDepartment.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String contactDepartment = thing.GetContactDepartment();
```

## GetContactId()

```crmscript theme={null}
Integer GetContactId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer contactId = thing.GetContactId();
```

## GetContactName()

```crmscript theme={null}
String GetContactName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Contact name.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String contactName = thing.GetContactName();
```

## GetCreatedAt()

```crmscript theme={null}
DateTime GetCreatedAt()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When the message was posted.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
DateTime createdAt = thing.GetCreatedAt();
```

## GetEmailHeader()

```crmscript theme={null}
String GetEmailHeader()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The email header is saved in this field as raw text.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String emailHeader = thing.GetEmailHeader();
```

## GetImportant()

```crmscript theme={null}
Bool GetImportant()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If this message is important or not.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Bool important = thing.GetImportant();
```

## GetNumAttachments()

```crmscript theme={null}
Integer GetNumAttachments()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of attachments in the message.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer numAttachments = thing.GetNumAttachments();
```

## GetPersonFullName()

```crmscript theme={null}
String GetPersonFullName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Gets the persons full name (internal name used in clients for employees).

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String personFullName = thing.GetPersonFullName();
```

## GetPersonId()

```crmscript theme={null}
Integer GetPersonId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer personId = thing.GetPersonId();
```

## GetSlevel()

```crmscript theme={null}
Integer GetSlevel()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The security-level of the message. See \<xref href="CRMScript.NetServer.TicketSecurityLevel" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer slevel = thing.GetSlevel();
```

## GetTicketMessageId()

```crmscript theme={null}
Integer GetTicketMessageId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key (auto-incremented).

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer ticketMessageId = thing.GetTicketMessageId();
```

## SetAuthor(String)

```crmscript theme={null}
Void SetAuthor(String author)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String author;
thing.SetAuthor(author);
```

## SetContactDepartment(String)

```crmscript theme={null}
Void SetContactDepartment(String contactDepartment)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String contactDepartment;
thing.SetContactDepartment(contactDepartment);
```

## SetContactId(Integer)

```crmscript theme={null}
Void SetContactId(Integer contactId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer contactId;
thing.SetContactId(contactId);
```

## SetContactName(String)

```crmscript theme={null}
Void SetContactName(String contactName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String contactName;
thing.SetContactName(contactName);
```

## SetCreatedAt(DateTime)

```crmscript theme={null}
Void SetCreatedAt(DateTime createdAt)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
DateTime createdAt;
thing.SetCreatedAt(createdAt);
```

## SetEmailHeader(String)

```crmscript theme={null}
Void SetEmailHeader(String emailHeader)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String emailHeader;
thing.SetEmailHeader(emailHeader);
```

## SetImportant(Bool)

```crmscript theme={null}
Void SetImportant(Bool important)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Bool important;
thing.SetImportant(important);
```

## SetNumAttachments(Integer)

```crmscript theme={null}
Void SetNumAttachments(Integer numAttachments)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer numAttachments;
thing.SetNumAttachments(numAttachments);
```

## SetPersonFullName(String)

```crmscript theme={null}
Void SetPersonFullName(String personFullName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
String personFullName;
thing.SetPersonFullName(personFullName);
```

## SetPersonId(Integer)

```crmscript theme={null}
Void SetPersonId(Integer personId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer personId;
thing.SetPersonId(personId);
```

## SetSlevel(Integer)

```crmscript theme={null}
Void SetSlevel(Integer slevel)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer slevel;
thing.SetSlevel(slevel);
```

## SetTicketMessageId(Integer)

```crmscript theme={null}
Void SetTicketMessageId(Integer ticketMessageId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTicketMessage thing;
Integer ticketMessageId;
thing.SetTicketMessageId(ticketMessageId);
```


## Related topics

- [NSTicketEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketEntity.md)
- [NSTicketAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketAgent.md)
- [Working with NS classes in CRMScript](/en/automation/crmscript/netserver/ns-classes.md)
- [NSTicketMessageEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketMessageEntity.md)
- [NSTicketMessageHeader](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketMessageHeader.md)
- [TicketMessage](/en/api/archive-providers/reference/ticketmessage.md)
