Hi Edgar,
It's not a simple customization. Here's how I would go about it, there may be cleaner approaches to this..
High level steps:
1. Spel trigger captures type changing
2. Trigger calls spel script which creates event
3. Event fires action that sends a multiple notification
4. Multiple notification sends off email to recipients with attached message template
Multiple Notification Macro:
Symbol: zCR Type Change Notification
Message Template: <link existing message template. Note the attributes are referenced without the object prefix. e.g., @{category.sym}. This only applies to multiple notifications>
Object Contacts: <add assignee, requestor, or whoever else needs to be notified>
Event:
Name: zCR Type Change Event (event sym must be exact as it's hard coded into the script)
Object Type: Request/Incident/Problem
Work shift: <leave empty>
Condition: <leave empty>
Allow time resetting: Yes (allows spel script to update the delay time)
On Done Event Flag: No History
Action Information - On True: zCR Type Change Notification (link previously created multiple notification)
Trigger: zCR.mod (example name, use this or merge in an existing mod file)
MODIFY cr POST_VALIDATE z_cr_type_notification() 10050 FILTER(type{} && EVENT("UPDATE"));
Spel file:
cr::z_cr_type_notification(...) {
object attached_events_table_record_notify, evt_group_leader_notify;
string persid, event_sym_notify, evt_persid_notify, method;
persid = persistent_id;
method ="cr::z_cr_type_notification";
logf(MILESTONE, "%s started", method);
event_sym_notify = "zCR Type Change Event";
evt_persid_notify = (string)expand(format("&{'%s' = evt.sym->persistent_id}", event_sym_notify));
send_wait(0, top_object(), "get_co_group");
if (msg_error()) {
logf(ERROR, "%s - %s", ref_num, msg[0]);
}
evt_group_leader_notify = msg[0];
send_wait( 0, top_object(), "call_attr", "atev", "get_new_dob", NULL, NULL, evt_group_leader_notify);
if (msg_error()) {
logf(ERROR, "%s - %s", ref_num, msg[0]);
}
attached_events_table_record_notify = msg[0];
attached_events_table_record_notify.obj_id = persistent_id;
attached_events_table_record_notify.event_tmpl = evt_persid_notify;
attached_events_table_record_notify.wait_time = 0;
attached_events_table_record_notify.group_name = "zCRTypeChangeEventNotify";
send_wait(0, evt_group_leader_notify, "checkin");
if (msg_error()) {
logf(ERROR, "%s - %s", ref_num, msg[0]);
}
else {
logf(MILESTONE, "Successfully Created Notify Event %s", attached_events_table_record_notify.persistent_id);
}
logf(MILESTONE, "%s ended", method);
}