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

There doesn't appear to be any. I looked in both the set field values and the script column for anything changing the state. Only one sets the incident to closed if it is resolved.

Thanks so much for your suggestion and patience with me. On a fresh day, I compared your code to mine and found a discrepancy. Your code does work for me.

Where you are using inc.state = "3"; I am using inc.state.setValue(3);

I'm not sure why setValue doesn't work, but I'm happy that your code has made my BR work.

Thanks again.

Creating a BR on Catalog Task table.