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

Dubz
Mega Sage

Change the BR to before insert/update. If you're changing values on the current object use before, if you're changing values on other records use after.

Thanks for the suggestion David. I changed to before and it still did not update the incident state.

OK so check that there aren't any conflicting business rules or UI policies affecting that field. Try stripping back all your conditions and just confirming that you can actually change the state using the actions you have set.

Harish Ragz
Kilo Guru

Are you want to run Business Rule when Incident State changes from Awaiting state to an Assigned state? If it is true then remove all other filters except for state.