Business Rule not being triggered when records created via embedded list

Joshua Wallace
Tera Expert

Hi all,

I have a Business Rule which runs after an Affected CI ([task_ci]) is inserted, updated, or deleted, provided its conditions are met (that the Affected CI references a Change Request, and that it references a CI). Records in question are inserted/updated/deleted via an embedded list typically, which appears on the Change Request form.

Typically the Business Rule runs fine and works well. However, I have found an instance where this Business Rule does not run. If I specify CIs in the embedded list in a new form (i.e. before I insert the new Change Request), and then save it, the Change Request and all Affected CIs in the embedded list are created. However the Business Rule which should run when the records in the embedded list are inserted/updated do not.

This makes me think that, when the Affected CIs are inserted along with the Change Request, they do not initially reference a CI or Change Request, thus not triggering the Business Rule. However, they must be updated to reference the CI or Change Request as the records appear to be created as expected, yet the Business Rule still does not run. So perhaps Affected CIs are ignored when inserted along with the Change Request?

Does anyone have any experience with this problem, and know of a workaround?

Kind Regards,

Joshua

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Joshua,

Can you check what is the condition of the business rule?

Yes that seems to be correct analysis; the business rule condition might be change request is not empty but when you do from the embedded list of change request; the change request is already present for those task_ci record; for new record change request is not present hence it won't trigger

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

I actually removed all conditions of the Business Rule, however this did not correct the issue.

The Business Rule does run, but when it does run, the 'current' object (the task_ci record) is an empty shell. I verified this by logging the output of 'JSON.stringify(current)' in the Business Rule.

So that implies the task_ci record must be later updated to contain the relevant information. However, this update does not trigger the Business Rule.

I am thinking, in terms of a workaround, I somehow trigger the workflow after the Change Request is inserted, rather than after the task_ci is inserted. Unfortunately I cannot work on this now, but I will think about it further and update this question accordingly. Thank you for your assistance.