CWTKnowledgeUtil Class
Class to help with manipulation and information retrieval from Knowledge base records and their related classes, such as Categories and Articles.
Example Uses:
- var owner = CWTKnowledgeUtil.negotiateCategoryOwnership("35669ac2dbe9bb008408d12c5e961941", gs.getProperty("knowledge_base.managers_group"));
Constructor
Item Index
Methods
Methods
isFalse
-
value
Determine if a value should be considered true.
Due to a variety of ways of true/false values being returned by service now, this method exists to level set to a JavaScript boolean value for use.
Returns:
True if the value is considered as trying to be "true", false otherwise.
isFalse
-
value
Determine if a value should be considered false.
Due to a variety of ways of true/false values being returned by service now, this method exists to level set to a JavaScript boolean value for use.
Returns:
True if the value is considered as trying to be "false", false otherwise.
negotiateCategoryOwnership
-
category
-
[notify]
-
[table]
-
[field]
-
[field]
If the category has an owner and that owner is active, that owner is returned. If that owner is not active, the Category's parent is checked. This active/parent check continues until an active owner is found and returned, or null is returned for no active owner could be found.
Parameters:
-
category
GlideRecord | StringThe record or System ID of the Category to check.
-
[notify]
GlideRecord | String optionalIndicates the group to notify, if any, when no owner can be determined. Uses the System Property "knowledge_base.notify_table" to determine what table the notification is created against.
-
[table]
String optionalOptional string to specify the table against which the field value is defined. Defaults to "sys_user".
-
[field]
String optionalOptional string to specify the category value being searched for with an active flag. Defaults to "u_owning user.
-
[field]
String optionalTo handle the transition from "Category" to "Knowledge Base" where field names differ for the same class & meaning of property, this serves to indicate the field on the kb_knowledge_base table that should be pulled from the knowledge base when reached, if any. Defaults to "owner".
Returns:
Referencing the first active owner found or null if one could not be determined or none exists.
recurseCategoryOwner
-
category
-
[table]
-
[field]
-
[field]
Used by negotiateCategoryOwnership to perform the recursive lookup.
Parameters:
-
category
GlideRecordThe category to traverse looking for an active owner
-
[table]
String optionalOptional string to specify the table against which the field value is defined. Defaults to "sys_user".
-
[field]
String optionalOptional string to specify the category value being searched for with an active flag. Defaults to "u_owning user.
-
[field]
String optionalTo handle the transition from "Category" to "Knowledge Base" where field names differ for the same class & meaning of property, this serves to indicate the field on the kb_knowledge_base table that should be pulled from the knowledge base when reached, if any. Defaults to "owner".
Returns:
The user record or null.
Properties
descriptionFields
Array
Ordered array indicating the order in which to try to set a field to indicate details for a record or task.
groupFields
Array
Ordered array indicating the order in which to try to set a field to indicate what group is assigned to a record or task
summaryFields
Array
Ordered array indicating the order in which to try to set a field to indicate the summary or short description of a record or task.
userFields
Array
Ordered array indicating the order in which to try to set a field to indicate who should be considered the owner of a record.