The UserSkillAnalyzer API provides methods to analyze user skills against skills required to complete work items.

This API requires the Skills Management plugin (com.snc.skills_management), which you can activate if you have the admin role.

See Qualify and rank users based on skills and skill levels.

UserSkillAnalyzer - UserSkillAnalyzer()

Instantiates a new UserSkillAnalyzer object.

Table 1. Parameters
Name Type Description
None

Example


var userSkillAnalyzer = new SNC.UserSkillAnalyzer();

UserSkillAnalyzer - analyzeUserByID(String requiredSkillsJson, String userID, Boolean isSkillLevelEnforced)

Analyzes user skills against the required skills and sets the number of matching skills, skill level gap, and qualification that can be collected from an instance.

Analyzes whether an agent is qualified to work on a task by verifying if the agent has the skills and skill levels required to complete the task. If an agent is qualified to work on a task, the API analyzes the level gap between required skills and user's skill level which can be further used by the application to choose the best agent based on level gap. It also analyzes the total number of skills with and without skill levels the agent has to execute that task.

Table 2. Parameters
Name Type Description
requiredSkillsJson String List of required skills to compare with user.
Each skill is listed as a JSON entry in the following format:
  • sys_id: String. Sys ID of skill from the Skills [cmn_skill] table.
  • is_mandatory: Boolean. Flag that indicates whether the skill is mandatory.
  • level: String. Sys ID from the Skill Levels [cmn_skill_level] table.
userID String Sys ID from the User [sys_user] table.
isSkillLevelEnforced Boolean True if user must have a minimum skill level for all required mandatory skills, false otherwise. Default: false.
Table 3. Returns
Type Description
String JSON that contains all the required information about the user based on the analyzer skills map as follows:
  • sys_id: String. Sys ID from the User [sys_user] table.
  • is_qualified: Boolean. Flag that indicates whether the user is qualified for the required skills.
    • True if user has all the mandatory skills and skill level is enforced.
    • False if user does not have all mandatory skills or does not meet level requirements.
  • num_skills: Number. Skills matched against the required skills.
  • num_skills_matching_level: Number. User skills matching the required skill level.
  • total_skill_level_gap: Number. Skill level gap helps ranking algorithm find optimal user meeting minimum skill level requirements. Calculated based on overall gap between task skill level and user skill level. User must have required skill level for mandatory skills.
  • optional_skill_level_gap: Number. Provides skill level gap for optional skills only. Assists the end points in distinguishing between total skill level and optional skill level gap.

Error if inaccurate parameters or malformed JSON provided.

Example

var skills = [{"sys_id":"48c9f873c0a8018b65c3814608b201e6", "is_mandatory": true, "level":"4e0ac4d6b3332300290ea943c6a8dc4e"},
			  {"sys_id":"48c9fdddc0a8018b04bd8d7914c82c9d", "is_mandatory": false, "level":"4e0ac4d6b3332300290ea943c6a8dc4e"}];
var userSysID = "a8f98bb0eb32010045e1a5115206fe3a";
var userSkillAnalyzer = new SNC.UserSkillAnalyzer();
var result = userSkillAnalyzer.analyzeUserById(JSON.stringify(skills), userSysID, true);
gs.info('Results: ' + result);

Output:

Calling user analyzer
*** Script: Results: {"sys_id":"a8f98bb0eb32010045e1a5115206fe3a","is_qualified":false,"num_skills":0,"num_skills_matching_level":0,"total_skill_level_gap":0,"optional_skill_level_gap":0}

UserSkillAnalyzer - analyzeUserBySkills(String requiredSkillsJson, String userSkillsJson, Boolean isSkillLevelEnforced)

Analyzes user skills against the required skills and sets the number of matching skills, skill-level gap, and qualification that can be collected from an instance.

Table 4. Parameters
Name Type Description
requiredSkillsJson String List of required skills to qualify the users against.
Each skill is listed as a JSON entry in the following format:
  • sys_id: String. Sys ID of skill from the Skills [cmn_skill] table.
  • is_mandatory: Boolean. Flag that indicates whether the skill is mandatory.
  • level: String. Sys ID from the Skill Levels [cmn_skill_level] table.
userSkillsJson String List of user skills to determine qualification for required skills.
Each skill is listed as a JSON entry in the following format:
  • sys_id: String. Sys ID of skill from the Skills [cmn_skill] table.
  • is_mandatory: Boolean. Flag that indicates whether the skill is mandatory.
  • level: String. Sys ID from the Skill Levels [cmn_skill_level] table.
isSkillLevelEnforced Boolean True if user must have minimum skill level for all required mandatory skills, false otherwise. Default: false.
Table 5. Returns
Type Description
String JSON that contains all the required information about the user based on the analyzer skills map as follows:
  • sys_id: String. Sys ID from the User [sys_user] table.
  • is_qualified: Boolean. Flag that indicates whether the user is qualified for the required skills.
    • True if user has all the mandatory skills and skill level is enforced.
    • False if user does not have all mandatory skills or does not meet level requirements.
  • num_skills: Number. Skills matched against the required skills.
  • num_skills_matching_level: Number. User skills matching the required skill level.
  • total_skill_level_gap: Number. Skill level gap helps ranking algorithm find optimal user meeting minimum skill level requirements. Calculated based on overall gap between task skill level and user skill level. User must have required skill level for mandatory skills.
  • optional_skill_level_gap: Number. Provides skill level gap for optional skills only. Assists the end points in distinguishing between total skill level and optional skill level gap.

Error if inaccurate parameters or malformed JSON provided.

Example

var skills = [{"sys_id":"48c9f873c0a8018b65c3814608b201e6", "is_mandatory": true, "level":"4e0ac4d6b3332300290ea943c6a8dc4e"},
				{"sys_id":"48c9fdddc0a8018b04bd8d7914c82c9d", "is_mandatory": false, "level":"4e0ac4d6b3332300290ea943c6a8dc4e"}];
var userSkills = [{"sys_id":"48c9f873c0a8018b65c3814608b201e6", "is_mandatory": true, "level":"4e0ac4d6b3332300290ea943c6a8dc4e"},
		    {"sys_id":"k, th", "is_mandatory": false, "level":"4e0ac4d6b3332300290ea943c6a8dc4e"}];
var userSkillAnalyzer = new SNC.UserSkillAnalyzer();
var result = userSkillAnalyzer.analyzeUserBySkills(JSON.stringify(skills), JSON.stringify(userSkills));
gs.info('Results: ' + result);