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

@Koti Majji 

what debugging did you do?

Is the BR actually triggering?

Is it going inside that IF statement?

try this line

 caseRecord.u_time_worked.setDateNumericValue(current.time_worked.dateNumericValue());

💡 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 

 

1. Added logs using gs.info() at start and inside If.

2. Added info messages at start and inside If.

3. Debug Business Rule - Session Log.

 

I don't see any message, log information.

 

Please let me know if anything I need to check.

@Koti Majji 

it means BR is not triggering, something wrong in condition

share BR config screenshots

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

@Koti Majji 

looks fine to me

Did the field get changed so that BR triggers?

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