How to make Predictive Intelligence models work in Incident form?

SNDP
Tera Contributor

I have trained the models, and while testing the solutions it predicts successfully for the assignment group/business service/Service Offering, but how do I make it work with the incident form because even after saving the incident the PI doesn't predict anything.  

Thank you in advance

1 ACCEPTED SOLUTION

Brian Bakker
ServiceNow Employee
ServiceNow Employee

Hello @SNDP 

 

To trigger predictions on the incident form can be done several ways. Out-of-box, we provide a BEFORE INSERT business rule "Default Task Based Prediction" on table [task] as a template. If the Classification solution has the Input table [incident], then you should create a new BEFORE INSERT BR on table [incident] using Machine Learning APIs to trigger a prediction. You also need duplicate the Business Rule "Update Prediction Results" and ensure it is created on the same table, as the Classification Solution Input table. This is to ensure predictions are updated in [ml_predictor_results] table with Final Values, once the source record where the prediction was made is made inactive.

 

If you want to avoid scripting a BR, you can also use Machine Learning solutions for Flow Designer, and use a workflow to trigger the prediction on your Classification solution that does not require any scripting.

 

I hope this helps.

 

Regards,

Brian

View solution in original post

8 REPLIES 8

Brian Bakker
ServiceNow Employee
ServiceNow Employee

@RVM 

No. In order to save the prediction result in this table, it requires the record to be saved first, so that it can populate the Source ID field. Out-of-box, we do this with a Before Insert BR.

 

Our philosophy has always been "why record predictions, when they are not used/saved"

 

If you want to record predictions without saving the record first, you will then need to customise it, and manually add the prediction result into this table using the GlideRecord API to insert the record with the values returned from the prediction.

Brian Bakker
ServiceNow Employee
ServiceNow Employee

@RVM 

Predictor results are only recorded in table [ml_predictor_results], if the sys_id for the record has been created in the database, hence out-of-box, we use a Before Insert BR to make the prediction and then use the applyPrediction method to record the prediction in the [ml_predictor_results] table.

 

If your requirement is to record predictions in table [ml_predictor_results] before saving the record, you will need to customise it using the GlideRecord API, and manually add the record into the [ml_predictor_results] table by passing the values from the prediction and use the setValue method to create this record to record the prediction.

Hi @Brian Bakker

What's your suggestion for the use case where I have the form with 3 levels of categories which are mandatory. I want to help user with categorization so the idea is that he will get suggestions from PI after he will provide all required inputs (description, short description). That means it must happen before saving the form.

Hi Brian, 

 

Thank you. Tried the flow designer solution proposed by you and it worked. I somehow feel this should be mentioned in the Predictive Intelligence docs as well. It will be helpful if this solution is part of docs.

 

Regards,

Geetika