lauri457
Kilo Patron

At a quick glance I would say it is that your event registration has table as sc_req_item but your notification is on sc_task and you are creating the events with sc_tasks.

 

Also consider how you access the variable values of your item not just for performance but for also readability. When you dotwalk inside a gliderecord loop you end up doing wasteful round trips to the database when you can just let the database handle the work. 

var gr = new GlideRecord("sc_item_option_mtom");
gr.addQuery("request_item", reqItemSysId)
	.addCondition("sc_item_option.item_option_new.name", "multitask")
	.addCondition("sc_item_option.value", "true")
gr.setLimit(1);
gr.query();
answer = gr.hasNext();

 

//when current is sc_req_item
current.variables.multitask.getValue() === "true"

Also there is no point in passing record fields of the event record as event parameters as everywhere that you handle events the platform will query the record for you anyway.