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

 Release :

    - australia

ft:locale :

    - pt-BR

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}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

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.

## Antes de Iniciar

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/7jkuhsHFQ8bJYL7yDhNvuw "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/WbpJ1Cy2HqQRCM6FeBSEHA "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

## Por Que e Quando Desempenhar Esta Tarefa

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.

## Procedimento

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/9mSqp1GiMa8MiuiziYhbng "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.

## O que Fazer Depois

Review [Vulnerability Response assignment rules overview](https://servicenow-prod.fluidtopics.net/TtvwK0xR7o7ubzIMvklwog "Define the criteria by which vulnerable items (VITs) are automatically assigned to an assignment group for remediation.") for more general information about assignment rules and the Reapply all vulnerability assignment rules scheduled job.

