Hi Gutis!
Thanx for your reply!
Well, I do not know if I'm doing something wrong, since I'm not very familiar with spel code, but when creating the two files and performing tests creating a parent request, associating a child with it and defining its status as "solved", the status of the parent ticket was not changed to WIP.
I did some searching in the STDLOG file but couldn' t find any errors connected to the newly created SPEL and MODS files.
I've tried modifying some variables from line 4, modifying the status constraint to something like:
wc = format ("parent = '% s' AND status = 'RE'", persistent_id);
But even doing some tests of the type did not succeed in changing the status of the parent ticket.
These files should be created in the C:\Program Files (x86)\CA\Service Desk Manager\site\mods\majic folder, right?
The mods and spl files:
OBJECT cr {
TRIGGERS {
POST_VALIDATE set_to_wip() 10024 FILTER( EVENT("INSERT UPDATE") && status{->RE} );
};
};
cr::set_to_wip(...){
string wc;
int active_count;
wc = format("parent = '%s' AND status != 'RE' AND status != 'CL'", persistent_id);
send_wait(0, top_object(), "call_attr", "cr", "sync_fetch", "MLIST_STATIC", wc, -1,0);
active_count = msg[1];
logf(SIGNIFICANT, "%s",active_count);
if (active_count > 0) {
return;
}else
{
uuid who;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
who=msg[0];
send_wait(0, top_object(), "call_attr", "api", "generic_status_change", who, parent.persistent_id, "All Children resolved", "crs:5208");
if (msg_error()) {
logf(ERROR,"Error %s",msg[0]);
}
}
}
Thanx again for the help, Gutis!