AnsweredAssumed Answered

Change Parent Status When Child is Resolved

Question asked by diegolimabsb on Jul 17, 2017
Latest reply on Sep 13, 2017 by diegolimabsb

Hey guys,

 

Im trying to do a customization to set the parent status to WIP when all the children are solved.

 

For this, i create a condition macro with the code below:

 

string wc; 
int active_count;
wc = format("parent = '%s' AND status == 'RE'", 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) {
set_return_data(FALSE);
}else
{
set_return_data(TRUE);
}

 

This condition macro was related to an event with a action macro that changes the ticket status to WIP with th code below:

 

misc::change_ticket_status(this, group_leader, attached_event, event_tmpl, 'WIP');

 

I've found in some of my searches a lot of stuff related to spel code, but I'm not very familiar with spel.

 

Is there any way to do this customization in a simple way or even using spel code?

 

Many thanx!!

Outcomes