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

Ankur Bawiskar
Tera Patron
Tera Patron

@Koti Majji 

you didn't share the BR script and config screenshots

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar : Hi Ankur, thank you for the reply. Updated my post with BR. Kindly look into it. Thank you!

Ankur Bawiskar
Tera Patron
Tera Patron

@Koti Majji 

u_time_worked field should be of type Duration then it will work

did you debug and see it went inside that IF?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Thank you for the response. Yes, we used duration type only. However, it's not working. When we're doing update in background, it's working. When it comes to Business Rule, it's not triggering. Please suggest what can be done. Thank you.