CA Service Management

 View Only

 Create or modify the option close all children

Jonathan Morales Baez's profile image
Jonathan Morales Baez posted Jun 24, 2021 01:25 PM
Hi

I am interested in creating an option that marks the associated tickets as children from the parent in resolved status and that in turn puts the same resolution comment to all.

It would be this or modify the option of close all children so that instead of closed status it will be resolved.

Take into account that I have transition status as well as attribute control and that to mark the resolved status I should have the CI populated, as well as the assigned person

any suggestion
Allan Salas's profile image
Allan Salas
Hola Jonathan, 

Esto se puede hacer a través de código spel, puede ser algo similar a esto:

--Trigger:

OBJECT alg {
TRIGGERS {
POST_VALIDATE zpropagaSol() 500 FILTER(EVENT("INSERT"));
};
};

--SPL CODE:
alg::zpropagaSol(...) {
string c_persid,wc;
object c_dob,c_list,group_leader,ticket;
int c_count,i;

wc = format("parent = '%s'", call_req_id);
send_wait(0, top_object(), "call_attr", "cr", "sync_fetch", "MLIST_STATIC", wc, -1, 0);
c_count = msg[1];
c_list = msg[0];
if (c_count > 0 && type == "RE") {
for (i = 0; i < c_count; i++) {
send_wait(0, top_object(), "get_co_group");
group_leader = msg[0];
send_wait(0, c_list, "dob_by_index", "DEFAULT", i, i);
c_dob = msg[0];
send_wait(0, c_dob, "get_attr_vals", 3, "ref_num", "type.sym", "persistent_id");
c_persid = msg[9];
send_wait(0, top_object(), "call_attr", "cr", "dob_by_persid", 0, c_persid);
ticket = msg[0];
send_wait(0, top_object(), "get_co_group");
group_leader = msg[0];
send_wait(0, group_leader, "checkout", ticket);
send_wait(0, ticket, "change_status", group_leader, analyst, description, call_req_id.status, NULL);
send_wait(0, group_leader, "checkin");
if (msg_error()) {
logf(ERROR, "Error actualizando caso hijo: %s %s",c_persid, msg[0]);
}

}
}
}

Este código busca todos los casos hijos del caso que está siendo resuelto y va a propagar el estado, comentario y usuario que realiza la acción, tome en cuenta que este spl no está probado en un ambiente funcional, por lo que puede requerir algunos ajustes, tómelo como un ejemplo base. 

Saludos,