Changes done on list view should affect to things related to the record

Arjun Reddy Yer
Mega Sage

Required help @Vasantharajan N @Ankur Bawiskar @Voona Rohila @WillieW 

 

When changes are done on list view that should reflect to things (attached records) related to the record. 

List View:

 

ArjunReddyYer_0-1765215435759.png

 

Related Records:

In the below mentioned related records Impact & Priority needs to be change when Impact & Priority cahnged on list view

 

ArjunReddyYer_1-1765215599121.png

 

1 ACCEPTED SOLUTION

Add BR Trigger conditions properly something like - impact changes || priority changes

 

Refer sample logic below:

//sample logic
var grST = new GlideRecord('child table') // childtablename
grST.addQuery('parent',current.sys_id); // add your related list condition, added parent as example.
grST.query();
while(grST.next())
{
grST.priority = current.priority // map directly if backend values are same else do an if check and map it.
grST.impact = current.impact //map directly if backend values are same else do an if check and map it.
grST.update();

]

 

There are so many similar ootb functionalities( Incident to Incident task, Change to Change Task), you can take a look in your instance.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

7 REPLIES 7

Add BR Trigger conditions properly something like - impact changes || priority changes

 

Refer sample logic below:

//sample logic
var grST = new GlideRecord('child table') // childtablename
grST.addQuery('parent',current.sys_id); // add your related list condition, added parent as example.
grST.query();
while(grST.next())
{
grST.priority = current.priority // map directly if backend values are same else do an if check and map it.
grST.impact = current.impact //map directly if backend values are same else do an if check and map it.
grST.update();

]

 

There are so many similar ootb functionalities( Incident to Incident task, Change to Change Task), you can take a look in your instance.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Tried with below script in business rule but values in the attached records (impact & priority) is not getting change

Business Rule:

 

ArjunReddyYer_0-1765275623600.png

 

        var grST = new GlideRecord('sn_safe_story') // childtablename
        grST.addQuery('assignment_group.nameSTARTSWITHchaos', current.sys_id); //related list condition
        grST.query();
        while (grST.next()) {
            grST.priority = current.priority // map directly as backend values are same else do an if check and map it.
            grST.impact = current.impact //map directly as backend values are same else do an if check and map it.
            grST.update();

You have to check insert/update as per your requirements.

insert - Triggers when record is inserted 

Update - Triggers when record is updated.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP