I would like to add a field from the vulnerability table (CISA Due Date) to the Vulnerable Table

JamesNicol_1
Tera Contributor

I would like to add add a field from the vulnerability table in vulnerability response application to the vulnerable Item table using business rules.

 

The vulnerability table is sn_vul_entry and the field name is due_date

 

I have created a new field in the vulnerable item table (sn_vul_vulnerable_item) called u_cisa_due_date.

1 ACCEPTED SOLUTION

Bhuvan
Kilo Patron

@JamesNicol_1 

 

Create Business Rule as below on 'sn_vul_entry' table. When 'due_date' field is created or updated on the 'Vulnerability Entry' table it will update field 'u_cisa_due_date' field in 'Vulnerable Item' table.

 

Bhuvan_0-1756015934872.png

 

Bhuvan_2-1756016130910.png

(function executeRule(current, previous /*null when async*/) {
// Add your code here
var vulItems = new GlideRecord('sn_vul_vulnerable_item');
vulItems.addQuery('vulnerability', current.id );
vulItems.query();	
while ( vulItems.next() ) 
{
vulItems.setValue('u_cisa_due_date',current.due_date);
vulItems.update();
}
})(current, previous);

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @JamesNicol_1 

So, what is the issue now? To add that field in the form, open the required form, right-click on the context menu → Configure → Form Layout, and then add the field.

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

I just don't want to just add it to the form, I would like to add the CISA due date field found in the vulnerability table to the vulnerable item table.  I have already created a dictionary entry in the vulnerable item table. I am looking for a business rule that would add the "CISA due date" field to records in the vulnerable item table.

Bert_c1
Kilo Patron

I don't have a field named 'due_date' on the 'sn_vul_entry' table. If you have this a BR defined on that table, for Insert and Update can find records in the 'sn_vul_vulnerable_item' where the value of the 'vulnerability' field there matches the sys_id of the record in 'sn_vul_entry' being created/updated. And update a field there with the value of a 'sn_vul_entry' field. Do you need logic help? You can review OOB business rules to see similar behavior.

Yes. If you can please provide a business rule that does the following:

 

Table 1

Field called due_date gets updated or inserted into the sn_vul_entry table.

 

Table 2

How do copy the values of sn_vul_entry.due_date into  user created field called sn_vulnerable_item.u_kev_due_date?