> ## 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.

# NSTicket

## Constructors

### NSTicket()

```crmscript theme={null}
NSTicket
```

Initializes a new instance of the NSTicket class.

## Methods

## GetActivate()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When the ticket should be activated, if it is postponed.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime activate = thing.GetActivate();
```

## GetAlertLevel()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The alert level for the ticket. Matches the level value of the ticket\_alert table.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer alertLevel = thing.GetAlertLevel();
```

## GetAlertTimeout()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The datetime for when the ticket should jump to the next alert\_level.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime alertTimeout = thing.GetAlertTimeout();
```

## GetAuthor()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - A string representing the author of the ticket (same as author of first message).

**Example:**

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

## GetBaseStatus()

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

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer baseStatus = thing.GetBaseStatus();
```

## GetCategory()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the category a ticket is in.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer category = thing.GetCategory();
```

## GetCategoryFullname()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The fullname (compiled from parents' names) for this category. E.g. 'norway/product A/support'.

**Example:**

```crmscript theme={null}
NSTicket thing;
String categoryFullname = thing.GetCategoryFullname();
```

## GetCategoryName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The (short) name of this category. E.g. 'support'.

**Example:**

```crmscript theme={null}
NSTicket thing;
String categoryName = thing.GetCategoryName();
```

## GetClosedAt()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When the ticket was closed.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime closedAt = thing.GetClosedAt();
```

## GetConnectId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If a ticket is connected to another ticket, this field is set to the ID of the 'master' ticket.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer connectId = thing.GetConnectId();
```

## GetCreatedAt()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When the ticket was created.

**Example:**

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

## GetCreatedBy()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the user who created the ticket. 1 (system user) if the ticket was created externally.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer createdBy = thing.GetCreatedBy();
```

## GetCreatedByName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Initials, also login name, possibly database user name.

**Example:**

```crmscript theme={null}
NSTicket thing;
String createdByName = thing.GetCreatedByName();
```

## GetCustId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The reference to the customer. NULL or -1 if ticket is not connected to customer.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer custId = thing.GetCustId();
```

## GetDeadline()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Deadline for ticket.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime deadline = thing.GetDeadline();
```

## GetFirstReadByUser()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The datetime for when the ticket first was read by a user.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime firstReadByUser = thing.GetFirstReadByUser();
```

## GetFromAddress()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The from-address used when this ticket got created, e.g. by email.

**Example:**

```crmscript theme={null}
NSTicket thing;
String fromAddress = thing.GetFromAddress();
```

## GetHasAttachment()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Bool indicating if this ticket has one or more attachments.

**Example:**

```crmscript theme={null}
NSTicket thing;
Bool hasAttachment = thing.GetHasAttachment();
```

## GetLastChanged()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The last time the ticket was modified.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime lastChanged = thing.GetLastChanged();
```

## GetNumMessages()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total number of messages for this request.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer numMessages = thing.GetNumMessages();
```

## GetNumReplies()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The number of replies (messages) to the customer for this request.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer numReplies = thing.GetNumReplies();
```

## GetOrigin()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - What is the origin of this ticket? See \<xref href="CRMScript.NetServer.TicketOrigin" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer origin = thing.GetOrigin();
```

## GetOwnedBy()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the user who owns the ticket. 1 (system user) if the ticket is unassigned.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer ownedBy = thing.GetOwnedBy();
```

## GetOwnedByName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Initials, also login name, possibly database user name.

**Example:**

```crmscript theme={null}
NSTicket thing;
String ownedByName = thing.GetOwnedByName();
```

## GetPersonFirstname()

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

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String personFirstname = thing.GetPersonFirstname();
```

## GetPersonFullname()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Gets the full name for the primary person (customer).

**Example:**

```crmscript theme={null}
NSTicket thing;
String personFullname = thing.GetPersonFullname();
```

## GetPersonLastname()

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

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String personLastname = thing.GetPersonLastname();
```

## GetPersonMiddleName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Middle name or 'van' etc.

**Example:**

```crmscript theme={null}
NSTicket thing;
String personMiddleName = thing.GetPersonMiddleName();
```

## GetPriority()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The reference to the ticket\_priority table.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer priority = thing.GetPriority();
```

## GetPriorityName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The name of the priority.

**Example:**

```crmscript theme={null}
NSTicket thing;
String priorityName = thing.GetPriorityName();
```

## GetReadByCustomer()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The datetime for when the ticket was read by the customer.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime readByCustomer = thing.GetReadByCustomer();
```

## GetReadByOwner()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The datetime for when the ticket last was read by the owner.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime readByOwner = thing.GetReadByOwner();
```

## GetReadStatus()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Whether the owner has read the ticket or not (red, yellow, green). See \<xref href="CRMScript.NetServer.TicketReadStatus" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer readStatus = thing.GetReadStatus();
```

## GetRealTimeSpentExternally()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total time (seconds) within 24x7 the ticket has been in a external waiting status (configurable), not including current state.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeSpentExternally = thing.GetRealTimeSpentExternally();
```

## GetRealTimeSpentInternally()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total time (seconds) within 24x7 the ticket has been in an open status (configurable), not including current state.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeSpentInternally = thing.GetRealTimeSpentInternally();
```

## GetRealTimeSpentQueue()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total time (seconds) within 24x7 hours the ticket has been in a queue status, not including current state.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeSpentQueue = thing.GetRealTimeSpentQueue();
```

## GetRealTimeToClose()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Same as time\_to\_close, but not calculated based on priority.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeToClose = thing.GetRealTimeToClose();
```

## GetRealTimeToReply()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Same as time\_to\_reply, but not calculated based on priority.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeToReply = thing.GetRealTimeToReply();
```

## GetRepliedAt()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The datetime for when the ticket was replied to. I.e. the first external message added to the ticket.

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime repliedAt = thing.GetRepliedAt();
```

## GetSlevel()

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

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

**Example:**

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

## GetTicketId()

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

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer ticketId = thing.GetTicketId();
```

## GetTicketStatus()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - User-defined ticket status.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer ticketStatus = thing.GetTicketStatus();
```

## GetTicketStatusDisplayValue()

Gets the display name of the ticket status.

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

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String ticketStatusDisplayValue = thing.GetTicketStatusDisplayValue();
```

## GetTimeSpentExternally()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total time (seconds) within the priority's office hours the ticket has been in a external waiting status (configurable), not including current state.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeSpentExternally = thing.GetTimeSpentExternally();
```

## GetTimeSpentInternally()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total time (seconds) within the priority's office hours the ticket has been in an open status (configurable), not including current state.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeSpentInternally = thing.GetTimeSpentInternally();
```

## GetTimeSpentQueue()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The total time (seconds) within the priority's office hours the ticket has been in a queue status, not including current state.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeSpentQueue = thing.GetTimeSpentQueue();
```

## GetTimeToClose()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The time (minutes) between when the ticket was created and when it was closed. Calculated based on priority's time frame.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeToClose = thing.GetTimeToClose();
```

## GetTimeToReply()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The time (minutes) between when the ticket was created and when it was replied to. Calculated based on priority's time frame.

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeToReply = thing.GetTimeToReply();
```

## GetTitle()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The title of the ticket.

**Example:**

```crmscript theme={null}
NSTicket thing;
String title = thing.GetTitle();
```

## SetActivate(DateTime)

```crmscript theme={null}
Void SetActivate(DateTime activate)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime activate;
thing.SetActivate(activate);
```

## SetAlertLevel(Integer)

```crmscript theme={null}
Void SetAlertLevel(Integer alertLevel)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer alertLevel;
thing.SetAlertLevel(alertLevel);
```

## SetAlertTimeout(DateTime)

```crmscript theme={null}
Void SetAlertTimeout(DateTime alertTimeout)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime alertTimeout;
thing.SetAlertTimeout(alertTimeout);
```

## SetAuthor(String)

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

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

**Example:**

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

## SetBaseStatus(Integer)

```crmscript theme={null}
Void SetBaseStatus(Integer baseStatus)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer baseStatus;
thing.SetBaseStatus(baseStatus);
```

## SetCategory(Integer)

```crmscript theme={null}
Void SetCategory(Integer category)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer category;
thing.SetCategory(category);
```

## SetCategoryFullname(String)

```crmscript theme={null}
Void SetCategoryFullname(String categoryFullname)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String categoryFullname;
thing.SetCategoryFullname(categoryFullname);
```

## SetCategoryName(String)

```crmscript theme={null}
Void SetCategoryName(String categoryName)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String categoryName;
thing.SetCategoryName(categoryName);
```

## SetClosedAt(DateTime)

```crmscript theme={null}
Void SetClosedAt(DateTime closedAt)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime closedAt;
thing.SetClosedAt(closedAt);
```

## SetConnectId(Integer)

```crmscript theme={null}
Void SetConnectId(Integer connectId)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer connectId;
thing.SetConnectId(connectId);
```

## SetCreatedAt(DateTime)

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

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

**Example:**

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

## SetCreatedBy(Integer)

```crmscript theme={null}
Void SetCreatedBy(Integer createdBy)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer createdBy;
thing.SetCreatedBy(createdBy);
```

## SetCreatedByName(String)

```crmscript theme={null}
Void SetCreatedByName(String createdByName)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String createdByName;
thing.SetCreatedByName(createdByName);
```

## SetCustId(Integer)

```crmscript theme={null}
Void SetCustId(Integer custId)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer custId;
thing.SetCustId(custId);
```

## SetDeadline(DateTime)

```crmscript theme={null}
Void SetDeadline(DateTime deadline)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime deadline;
thing.SetDeadline(deadline);
```

## SetFirstReadByUser(DateTime)

```crmscript theme={null}
Void SetFirstReadByUser(DateTime firstReadByUser)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime firstReadByUser;
thing.SetFirstReadByUser(firstReadByUser);
```

## SetFromAddress(String)

```crmscript theme={null}
Void SetFromAddress(String fromAddress)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String fromAddress;
thing.SetFromAddress(fromAddress);
```

## SetHasAttachment(Bool)

```crmscript theme={null}
Void SetHasAttachment(Bool hasAttachment)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Bool hasAttachment;
thing.SetHasAttachment(hasAttachment);
```

## SetLastChanged(DateTime)

```crmscript theme={null}
Void SetLastChanged(DateTime lastChanged)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime lastChanged;
thing.SetLastChanged(lastChanged);
```

## SetNumMessages(Integer)

```crmscript theme={null}
Void SetNumMessages(Integer numMessages)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer numMessages;
thing.SetNumMessages(numMessages);
```

## SetNumReplies(Integer)

```crmscript theme={null}
Void SetNumReplies(Integer numReplies)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer numReplies;
thing.SetNumReplies(numReplies);
```

## SetOrigin(Integer)

```crmscript theme={null}
Void SetOrigin(Integer origin)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer origin;
thing.SetOrigin(origin);
```

## SetOwnedBy(Integer)

```crmscript theme={null}
Void SetOwnedBy(Integer ownedBy)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer ownedBy;
thing.SetOwnedBy(ownedBy);
```

## SetOwnedByName(String)

```crmscript theme={null}
Void SetOwnedByName(String ownedByName)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String ownedByName;
thing.SetOwnedByName(ownedByName);
```

## SetPersonFirstname(String)

```crmscript theme={null}
Void SetPersonFirstname(String personFirstname)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String personFirstname;
thing.SetPersonFirstname(personFirstname);
```

## SetPersonFullname(String)

Sets the full name for the primary person (customer)

```crmscript theme={null}
Void SetPersonFullname(String personFullname)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String personFullname;
thing.SetPersonFullname(personFullname);
```

## SetPersonLastname(String)

```crmscript theme={null}
Void SetPersonLastname(String personLastname)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String personLastname;
thing.SetPersonLastname(personLastname);
```

## SetPersonMiddleName(String)

```crmscript theme={null}
Void SetPersonMiddleName(String personMiddleName)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String personMiddleName;
thing.SetPersonMiddleName(personMiddleName);
```

## SetPriority(Integer)

```crmscript theme={null}
Void SetPriority(Integer priority)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer priority;
thing.SetPriority(priority);
```

## SetPriorityName(String)

```crmscript theme={null}
Void SetPriorityName(String priorityName)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String priorityName;
thing.SetPriorityName(priorityName);
```

## SetReadByCustomer(DateTime)

```crmscript theme={null}
Void SetReadByCustomer(DateTime readByCustomer)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime readByCustomer;
thing.SetReadByCustomer(readByCustomer);
```

## SetReadByOwner(DateTime)

```crmscript theme={null}
Void SetReadByOwner(DateTime readByOwner)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime readByOwner;
thing.SetReadByOwner(readByOwner);
```

## SetReadStatus(Integer)

```crmscript theme={null}
Void SetReadStatus(Integer readStatus)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer readStatus;
thing.SetReadStatus(readStatus);
```

## SetRealTimeSpentExternally(Integer)

```crmscript theme={null}
Void SetRealTimeSpentExternally(Integer realTimeSpentExternally)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeSpentExternally;
thing.SetRealTimeSpentExternally(realTimeSpentExternally);
```

## SetRealTimeSpentInternally(Integer)

```crmscript theme={null}
Void SetRealTimeSpentInternally(Integer realTimeSpentInternally)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeSpentInternally;
thing.SetRealTimeSpentInternally(realTimeSpentInternally);
```

## SetRealTimeSpentQueue(Integer)

```crmscript theme={null}
Void SetRealTimeSpentQueue(Integer realTimeSpentQueue)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeSpentQueue;
thing.SetRealTimeSpentQueue(realTimeSpentQueue);
```

## SetRealTimeToClose(Integer)

```crmscript theme={null}
Void SetRealTimeToClose(Integer realTimeToClose)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeToClose;
thing.SetRealTimeToClose(realTimeToClose);
```

## SetRealTimeToReply(Integer)

```crmscript theme={null}
Void SetRealTimeToReply(Integer realTimeToReply)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer realTimeToReply;
thing.SetRealTimeToReply(realTimeToReply);
```

## SetRepliedAt(DateTime)

```crmscript theme={null}
Void SetRepliedAt(DateTime repliedAt)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
DateTime repliedAt;
thing.SetRepliedAt(repliedAt);
```

## SetSlevel(Integer)

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

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

**Example:**

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

## SetTicketId(Integer)

```crmscript theme={null}
Void SetTicketId(Integer ticketId)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer ticketId;
thing.SetTicketId(ticketId);
```

## SetTicketStatus(Integer)

```crmscript theme={null}
Void SetTicketStatus(Integer ticketStatus)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer ticketStatus;
thing.SetTicketStatus(ticketStatus);
```

## SetTicketStatusDisplayValue(String)

Gets the display name of the ticket status.

```crmscript theme={null}
Void SetTicketStatusDisplayValue(String ticketStatusDisplayValue)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String ticketStatusDisplayValue;
thing.SetTicketStatusDisplayValue(ticketStatusDisplayValue);
```

## SetTimeSpentExternally(Integer)

```crmscript theme={null}
Void SetTimeSpentExternally(Integer timeSpentExternally)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeSpentExternally;
thing.SetTimeSpentExternally(timeSpentExternally);
```

## SetTimeSpentInternally(Integer)

```crmscript theme={null}
Void SetTimeSpentInternally(Integer timeSpentInternally)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeSpentInternally;
thing.SetTimeSpentInternally(timeSpentInternally);
```

## SetTimeSpentQueue(Integer)

```crmscript theme={null}
Void SetTimeSpentQueue(Integer timeSpentQueue)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeSpentQueue;
thing.SetTimeSpentQueue(timeSpentQueue);
```

## SetTimeToClose(Integer)

```crmscript theme={null}
Void SetTimeToClose(Integer timeToClose)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeToClose;
thing.SetTimeToClose(timeToClose);
```

## SetTimeToReply(Integer)

```crmscript theme={null}
Void SetTimeToReply(Integer timeToReply)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
Integer timeToReply;
thing.SetTimeToReply(timeToReply);
```

## SetTitle(String)

```crmscript theme={null}
Void SetTitle(String title)
```

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

**Example:**

```crmscript theme={null}
NSTicket thing;
String title;
thing.SetTitle(title);
```


## Related topics

- [NSTicketAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketAgent.md)
- [NSTicketEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketEntity.md)
- [NSTicketInfo](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketInfo.md)
- [NSTicketMessage](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketMessage.md)
- [NSTicketPriority](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketPriority.md)
- [NSTicketCategory](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketCategory.md)
