Blog_6_TM: Auto-Populating Category or Assignment Group Using ServiceNow Predictive Intelligence(PI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
ServiceNow Predictive Intelligence (PI) leverages supervised machine learning to automatically classify records, such as Category and Assignment Group, based on historical incident data. By analyzing textual inputs like the Short Description, PI predicts and populates field values, significantly reducing manual effort and improving ticket routing efficiency.
To automatically populate the Category or Assignment Group from an incident's Short Description, you must create and train a Classification Solution using ServiceNow Predictive Intelligence.
The steps below demonstrate how to configure Category auto-population. If your requirement is different, you can choose any supported output field while defining the classification solution.
Prerequisites
- Ensure the Predictive Intelligence plugin is installed, along with the Predictive Intelligence for Incident application.
- The selected output field (for example, Category) should not be mandatory. If it is configured as mandatory, other use cases may fail.
Before You Begin
Predictive Intelligence classification requires at least 1,000 historical records to build an effective training model. Having more high-quality historical data generally results in better prediction accuracy.
Step-by-Step Instructions
- Navigate to Predictive Intelligence > Classification > Solution Definitions.
- OOB solution definition is available . Recommendation is that create your Solution Definition and refer OOB one.
3.Update the filter condition based on your business requirements. For example, you can configure the filter as Assignment Group is one of 'XYZ'.
This feature is typically enabled only for specific business units that require automatic categorization. If not all business units will use this functionality, configure the filter to include only the applicable assignment groups or records. This ensures the classification model is trained only on relevant data and improves prediction accuracy.
4. Click on Activate & Train button . (When you will modify - Update& Train button will be available)
Testing:
1.Once you complete Train, an active ML Solution will be created under ML Solution Section.
2. Open it in new Window
3. Click on Test Solution Tab
4.Enter the Short Description of an incident that has sufficient historical data. Ideally, use a short description similar to existing incidents that already have the desired Category assigned.
For testing purposes, set the Prediction Threshold to a value between 1 and 3 to allow more predictions to be returned.
5.Click Run Test to execute the prediction.
6.Review the Output Summary, which displays the predicted Category (or the selected output field), along with the confidence score and other relevant prediction details.
Step-by-Step Instructions to automate it:
1. Create a Before Insert Business Rule
2. add filter condition same as Solution Definition
3 Add Following script in Advanced script
4. Update your Solution definition name
(function executeRule(current, previous /*null when async*/ ) {
var solutionNames = ["<Your Solution definition Name>"];
var predictor = new MLPredictor();
var info = "";
solutionNames.forEach(function(solutionName) {
var solution = predictor.findActiveSolution(solutionName);
if (!solution)
return;
/* The next line of code does the prediction and updates the current record. */
predictor.applyPredictionForSolution(current, solution);
/* If no prediction is done, do not build the prediction info message. */
if (!predictor.applyPredictionForSolution(current, solution))
return;
/* If user doesn't have 'itil' role, we don't build prediction info message. */
if (!gs.hasRole('itil'))
return;
/* Building prediction info message */
var fieldName = solution.getPredictedField();
var fieldLabel = current.getElement(fieldName).getED().getLabel();
var predictedDisplayValue = current.getDisplayValue(fieldName);
var msg = gs.getMessage("Predicted {0} for {1}.", [predictedDisplayValue, fieldLabel]);
if (info.length > 0)
info += " ";
info += msg;
});
/* Print out prediction info message on screen. */
if (info.length > 0) {
var incidentUrl = "<a href='" + current.getLink() + "'>" + current.number + ":</a>";
gs.addInfoMessage(incidentUrl + " " + info);
}
})(current, previous);
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti