Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Business Rule is not triggering on Task Time Worked table

Koti Majji
Tera Contributor

Hi Team,

 

We're working in a domain separation environment. I have a requirement to automatically update "Case Time Worked" custom field on Case (sn_customerservice_case) table when "Time worked" field is updated on Task Time Worked (task_time_worked) table.  We created a Business Rule  and tested. We can't see logs and it's even not triggering when debug.

 

Business Rule:

 

Table: task_time_worked

When to run: After Update

Condition: Time Worked | Changes

Script:

 var taskSysId = current.task;
    var caseRecord = new GlideRecord('sn_customerservice_case');
    if (caseRecord.get(taskSysId)) {
        caseRecord.u_time_worked = current.time_worked;
        caseRecord.update();
    }
 

Could you please assist on what additional steps to take on this?

 

Thank you! 

 

 

10 REPLIES 10

Hi @Koti Majji  -Did you verify the Task Sys ID against the actual Sys ID of the case record? It’s possible the code is not entering the if loop due to a mismatch.