The CreatorCon Call for Content is officially open! Get started here.

Business rule is triggered but not updating the record

kimberlylp
Tera Guru

I have a business rule to move my Incident State from an Awaiting state to an Assigned state if the Incident is Awaiting and the Task State changes.

I put a gs.log('updating INC state','CBT_BR_Task State'); in the Script field to see if the BR is triggered and it does write to the log. However, it does not take the action of changing the Incident state to Assigned.

What could be preventing the state change from happening?

 

See attached screen shots for Filter conditions and Actions

1 ACCEPTED SOLUTION

Hi Kimberly,

 

Please use the below script:

Condition: Add the required conditions related to the task in order to make sure when the script to run:

var inc = new GlideRecord("table_name_of_related_list_table");

inc.addEncodedQuery("parent_field_name=" + current.sys_id);

inc.query();

if(inc.next())//Add while instead of if for multiple child records

  {

       inc.state = "";//Add the assigned value of state.

       inc.update();

   }

 

Regards,

Ram M

View solution in original post

12 REPLIES 12

rammohanraomadd
Kilo Guru

Hi,

 

On which table the BR is created. As from the screenshot it seems there is a dot walking performed.

 

Regards,

Ram M

The BR is created at the Task, the update is occurring on the incident. The task has a related incident column. I am checking that the incident is in an Awaiting Access Hours state and there is a dispatch task to the customer premise.

If a user is updating task state, that means they are in contact with the customer and the task should change the Incident state to Assigned.

I have used the script section to get the incident via a gliderecord and rec.update the incident state, but it still does not change. At the end of the script I wrote to the log rec.state to see what it was; it says it was updated to assigned, but the record still shows Awaiting.

Hi Kimberly,

 

Please use the below script:

Condition: Add the required conditions related to the task in order to make sure when the script to run:

var inc = new GlideRecord("table_name_of_related_list_table");

inc.addEncodedQuery("parent_field_name=" + current.sys_id);

inc.query();

if(inc.next())//Add while instead of if for multiple child records

  {

       inc.state = "";//Add the assigned value of state.

       inc.update();

   }

 

Regards,

Ram M

Thanks for the suggestion, but as I said, I have used the script section to do the exact same code you've provided and it doesn't change the state of the Incident.

Hi,

 

Could you please check if there is any BR which is aborting the action?

 

Regards,

Ram M