I want to write business rule for task sla table [please see description]

snow34
Tera Contributor

Once the SLA is breached the assignment group should be "abc"

so in the business rule i have given condition as "HasBreached is true " 

so how to write script in advanced section so that it will set the assignemnet group on incident table

1 ACCEPTED SOLUTION

HI,

Use the below..

var gr = new GlideRecord('sc_task');
gr.addQuery('sys_id',current.task);
gr.query();
if(gr.next())
{
gr.assignment_group = "sys id of the group name";
gr.update();
}

View solution in original post

7 REPLIES 7

Vishnu Prasad K
Giga Guru

Hi,

 

var id = current.task;

var inc = new GlideRecord('incident');

inc.addQuery('sys_id' , id);

inc.query();

if(inc.next()){

inc.setValue('assignment_group' , gs.getProperty('abc');

)

 

You should create a system property, to follow best practices

Raghu Ram Y
Kilo Sage

Hi @snow

Create on After Update business rule on "task_sla" table.

In Advance script, write the below script

var gr = new GlideRecord('incident');
gr.addQuery('sys_id',current.task);
gr.query();
if(gr.next())
{
gr.assignment_group = "sys id of the group name";
gr.update();
}

I hope it helps, if so please mark it as HELPFUL and CORRECT.

@snow
Have you gone through my suggestion?

yes but the same thing i want on sc_task table