User

User

new User(client, properties)

User class
Parameters:
Name Type Description
client TDAPI The TDAPI client the User belongs to.
properties Object The properties to be initialized on the User object (see: Properties).
Properties:
Name Type Description
UID Number The ID of the user.
BEID GUID The BEID of the user.
BEIDInt GUID The integer-based BEID of the user.
IsActive Boolean A value indicating whether the user is active.
UserName String The username of the user.
FullName String The full name of the user.
FirstName String The first name of the user.
LastName String The last name of the user.
MiddleName String The middle name of the user.
Birthday DateTime The user's birthday.
Salutation String The salutation of the user.
DefaultAccountID Number The nickname of the user.
DefaultAccountName String The ID of the default account for the user.
PrimaryEmail String The primary email address for the user.
AlternateEmail String The alternate email address for the user.
ExternalID String The organizational ID for the user.
AlternateID String The alternate ID for the user.
Applications Array.<Object> The system-defined (i.e. non-Platform) applications for the user.
SecurityRoleName String The name of the user's global security role.
SecurityRoleID Number The ID of the user's global security role.
Permissions Array.<String> The global security role permissions for the user.
OrgApplications Array.<Object> The organizationally-defined (i.e. Platform) applications for the user.
GroupIDs Array.<Number> The IDs of the groups to which the user belongs.
ReferenceID Number The interger reference ID for the user.
AlertEmail String The alert email address for the user. System notifications will be sent to this email address.
ProfileImageFileName String The file name of the profile image for the user.
Company String The name of the user's company.
Title String The user's title.
HomePhone String The user's home phone number.
PrimaryPhone String The primary phone number for the user. This is a value such as "Work" or "Mobile".
WorkPhone String The user's work phone number.
Pager String The user's pager number.
OtherPhone String The user's other phone number.
MobilePhone String The user's mobile phone number.
Fax String The user's fax number.
DefaultPriorityID Number The default priority ID.
DefaultPriorityName String The default priority name.
AboutMe String The user's "about me".
WorkAddress String The user's work address.
WorkCity String The work city.
WorkState String The work state.
WorkZip String The work zip.
WorkCountry String The work country.
HomeAddress String The user's home address.
HomeCity String The home city.
HomeState String The home state.
HomeZip String The home zip.
HomeCountry String The home country.
DefaultRate Number The user's default billing rate. This only applies to Users, not Customers. Customers will always have this set to 0.
CostRate Number The user's cost rate. This only applies to Users, not Customers. Customers will always have this set to 0.
IsEmployee Boolean A value indicating whether or not this user is an employee. This only applies to Users, not Customers. Customers will always have this set to false.
WorkableHours Number The number of workable hours in a work day for the user. This only applies to Users, not Customers. Customers will always have this set to 0.
IsCapacityManaged Boolean A value indicating whether this user's capacity is managed, meaning they can have capacity and will appear on capacity/availability reports. This only applies to Users, not Customers. Customers will always have this set tp false.
ReportTimeAfterDate DateTime The date the user should start reporting time on after. This also governs capacity calaculation. This only applies to Users, not Customers. Customer will always have this set to an empty date.
EndDate DateTime The date the user is no longer available for scheduling and no longer required to log time after. This only applies to Users, not Customers. Customers will always have this set to an empty date.
ShouldReportTime Boolean A value indicating whether the user should report time. This only applies to Users, not Customers. Customers will always have this set to false.
ReportsToUID String The unique identifier of the user this user reports to.
ReportsToFullName String The full name of the user this user reports to.
ResourcePoolID Number The ID of the resource pool this user belongs to. This only applies to Users, not Customers. Customers will always have this set to -1.
ResourcePoolName String The name of the resource pool.
TZID Number ID of the time zone the user is in.
TZName String The name of the time zone the user is in.
TypeID '1' | '2' The type of the user (1 for User, 2 for Customer).
AuthenticationUserName String The authentication username of the user. This username is what will be used when authentication rather than the standard username field. This field only applied to non-TeamDynamix authentication types. This value should be unique across all username and authentication usernames in your organization. If the provided value is not unique, it will be ignored. This only applies to Users, not Customers. Customers will always have this set to an empty string.
AuthenticationProviderID Number The authentication provider the user will use to authenticate by its ID. Leave this value blank to specify TeamDynamix or when using SSO authentication. This value can be obtained from the ADmin application Authentication section by one of your organization's administrators who has access to modify authentication settings. If an invalid value is provided, this will use the default authentication provider for the organization. This only applies to Users, not Customers. Customers will always have this set to 0.
Attributes Array.<Object> The custom person attributes.
Gender Number The user's gender.
IMProvider String the instant messenger provider for the user.
IMHandle String The instant messenger username (or "handle") for the user.
Source:

Methods

addFunctionalRole(roleId, isPrimary) → {Promise.<Object>}

Adds the user to functional role if they are not already in that role. If they are in that role, this will update whether or not that role is the user's primary functional role.
Parameters:
Name Type Description
roleId Number The functional role ID.
isPrimary Boolean The functional role ID.
Source:
Returns:
A response message indicating if the operation was successful or not.
Type
Promise.<Object>

addGroup(groupId, isPrimaryopt, isNotifiedopt, isManageropt) → {Promise.<Object>}

Adds a group to the User account
Parameters:
Name Type Attributes Default Description
groupId Boolean
isPrimary Boolean <optional>
false
isNotified Boolean <optional>
false
isManager Boolean <optional>
false
Source:
Returns:
message
Type
Promise.<Object>

deleteFunctionalRole(roleId) → {Promise.<Object>}

Deletes a functional role from the User account
Parameters:
Name Type Description
roleId Number The functional role ID.
Source:
Returns:
A response message indicating if the operation was successful or not.
Type
Promise.<Object>

getFunctionalRoles() → {Promise.<Array.<Object>>}

Gets the User's functional roles
Source:
Returns:
functionalRoles
Type
Promise.<Array.<Object>>

getGroups() → {Promise.<Object>}

Gets the User's groups
Source:
Returns:
groups
Type
Promise.<Object>

getTickets(appId, searchParams) → {Promise.<Array.<Ticket>>}

Gets Tickets requested by the User
Parameters:
Name Type Description
appId any
searchParams any
Source:
Returns:
Type
Promise.<Array.<Ticket>>

removeGroup(groupId) → {Promise.<Object>}

Removes a group from the User account
Parameters:
Name Type Description
groupId any
Source:
Returns:
message
Type
Promise.<Object>

setActive(status) → {Promise.<Object>}

Sets the User's active status
Parameters:
Name Type Description
status Boolean
Source:
Returns:
message
Type
Promise.<Object>

update() → {Promise.<User>}

Updates the User
Source:
Returns:
user
Type
Promise.<User>