Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

cmdb_ci and task_ci

ryadavalli
Tera Expert

I have a business rule on task_ci (Affected Cis) which upon deleting the CI from affected cis   will throw a message saying you cannot delete if it a primary Ci as well.

But when I try to delete a CI from cmdb_ci, if that ci is a part of an INC, the above business rule is triggered. Why?

12 REPLIES 12

TylerH129589623
Tera Guru

task_ci is a relationship between the CI and the Task. when you delete a CI it deletes the relationship record for the task and the CI. this will trigger your business rule on task_ci.


Got it Tyler. Thanks for the explanation. but "Prevent removal/update of primary CI" which is a OOB business rule, is triggered, but it does not prevent the CI to be deleted from cmdb_ci. That's the problem. It deletes the CI and then the BR is triggered.


How can we prevent that?


That OOB script is checking to see if the cmdb_ci field on the task is populated with the CI that is on the task_ci record. if it is, then it should stop the delete. make sure this is the case.


Yes I saw that condition, but when I delete the CI from the cmdb_ci table, that condition will fail,


current.ci_item == current.task.cmdb_ci, but even then it triggers this BR and show the error message but donnot abort the action ?