Tool object has a few service methods and fields. Use them for multiple purposes:

  • to retrieve system settings such as Targetprocess URL path, Service desk path, Company name;
  • to convert names of entity types to custom process terms;
  • to transform HTML descriptions to the format suitable for transfer via emails.

📘

Methods vs Fields

A method is a set of commands (functions) referred to by name. You are able to execute all the commands by using the name of the method. Methods can take values as parameters and return a value as a result.

A field is a member variable that belongs to an object.

Methods

MethodsParametersReturnsDescription
UrlObject entity, Object userStringReturns a URL (string) of the view/edit page for the specified entity object. The user object is required to verify permissions.
TermString entity_nameStringRewrites an entity name (Term) with one customized in the Default process.

Examples: How to use terms.
Process
Sanitize
String htmlStringProcesses HTML-formatted text from Descriptions. Replaces relative URLs and paths with absolute URLs and paths to ensure proper display.
ApplyStyleToMentionString htmlStringProcesses HTML-formatted text from Descriptions. Replaces system tags for @mentions with properly styled strings.
ShowOnlineLinkObject userBooleanUsed only in the Comment Created template. Checks if the link to view a request can be opened by a recepient. Returns false only if the recepient is a Requester and the Service Desk is not enabled. Returns true when the Service Desk is enabled.

Fields

FieldTypeDescription
[Deprecated]
CompanyName
StringThe name of your company, if it has been set in the past.

Value is retrieved from GlobalSettings data table. The table is accessible within API or SQL scripts only. Access from UI is not supported anymore.

Defaults to "Targetprocess" if the name of the company is not specified in the data table.

Replace references to this variable with hard-coded actual name of your company when required.
HelpDeskPortalPathStringThe absolute URL to your Service Desk or Help Desk portal.

For Service Desk it is updated automatically when you activate the portal.

For obsolete Help Desk portal it should be set manually in Targetprocess System Settings.
ApplicationPathStringThe absolute URL to your Targetprocess application.