---
sourceDocument: Australia Security Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/security-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Security Management

ft:clusterId :

    - security

bundleId :

    - security

workflow :

    - Technology


---

# Create a Vulnerability Response assignment rule using ML

# Create a Vulnerability Response assignment rule using ML {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Use the following script to create a catch-all assignment rule for vulnerable items that uses ML recommendations from Predictive Intelligence to automatically assign them for remediation.

## Before you begin

The Vulnerability Assignment Recommendations for Vulnerability Response application must be installed and activated. This application is available on the ServiceNow Store.

A classification solution must be defined, active, and trained. You use this model to help you predict the appropriate assignment group for vulnerable items (VI)s in cases when your assignment rules did not find a correct match for
the intended recipients.

This rule might help you reduce the number of unassigned VIs after other assignment rules have already completed.

See [Install Vulnerability Assignment Recommendations for Vulnerability Response](https://servicenow-prod.fluidtopics.net/TQtP1lWll4Zm6GJKDTsvag "Install Vulnerability Assignment Recommendations so that you can reduce the time that you spend on identifying owners for vulnerability findings that are unassigned or incorrectly assigned. This application is available as a separate subscription in the ServiceNow Store.") and [Create and train a solution definition for Vulnerability Response](https://servicenow-prod.fluidtopics.net/gbKYRbJKj0ff1gLNHiHoig "Create and train a solution definition model for Vulnerability Response by using Predictive Intelligence. You can use this model to predict the assignment group for a vulnerable item (VI) or remediation task (RT) based on existing data.") for more information.

Role required: sn_vul.vulnerability_admin

## About this task

You might prefer to perform this task only if you have advanced coding experience, or you have in-depth knowledge about the ServiceNow AI Platform, its Predictive Intelligence features, and how assignment rules work.

## Procedure

1. Navigate to AllVulnerability ResponseAdministrationAssignment Rules.
2. Select New.
3. Fill in the fields on the form, as appropriate.  
   See [Create or edit Vulnerability Response assignment rules](https://servicenow-prod.fluidtopics.net/~F6X16AyH_Z7pLhpvkyLfA "After you complete your initial assessment of assignment rules using Setup Assistant, you can create rules to automatically assign vulnerable items based on filter conditions. These rules assign vulnerable items as they are imported or manually created.") for more information about these fields.
4. From the Assign using choice list, select Script.
5. In the editor, copy and paste the following script.  

           /*
           * Catch-all assignment rule using ML recommendation
           * NOTE: Requires Vulnerability Assignment Recommendations for Vulnerability Response 
           * Classification Solution must be active and trained
           */
       var vitID = current.sys_id;
       getMLAssignmentRecommendation(vitID);

       function getMLAssignmentRecommendation(vulnerableItemSysId) {
           var ARU = new sn_vul.AssignmentRecommendationUtils();
           ARU.initialize();
           
           var viPredictionObj = ARU.getPredictionsForVI(vulnerableItemSysId);  
           /*
           *returns object containing array of predictions
           *payload structure:
           *
           {
               "predictions": [
                   {
                       "sys_id": "b6ed54f3db7b23005daef4eabf9619f3",
                       "name": "Windows Server support ",
                       "confidence_score": "57.54"
                   },
                   ...
               ],
               "exception": ""
           }
           */
           var viPredictionArray = viPredictionObj['predictions'];
           var topPredictionObj = viPredictionArray.shift();
           
           return topPredictionObj['sys_id'];
       }

6. Select Submit.

## What to do next

Review for more general information about assignment rules and the Reapply all vulnerability assignment rules scheduled job.

*[\>]: and then


