Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to set incident assignment group's manager in assigned to field on problem record

Hareesha
Tera Contributor

I have a requirement whenever i am creating a Problem from incident form, On problem record assigned to field should populate with Incident  assignment group's manager .

 

can anyone help me on this?

 

Thanks?

2 REPLIES 2

Community Alums
Not applicable

Hi @Hareesha ,

You can write a Business rule and dot walk to get the value of assignment groups manager of the incident, and set it into the problems assigned_to field. i.e..

// prob.assigned_to = current.assignment_group.manager;

 

prob = GlideRecord object for problem.

current = current record object from incident

 

Thanks, Hope this helps.

Sid_Takali
Kilo Patron

Hi @Hareesha Write Before Insert BR on Problem table. Use below Script.

 

var gr = new GlideRecord('incident');
    gr.addQuery('sys_id', current.first_reported_by_task);
    gr.query();
    if (gr.next()) {
		current.assignment_group = gr.assignment_group;
        current.assigned_to = gr.assignment_group.manager;
    }

 

SiddharamTakali_0-1718041562879.png

 

SiddharamTakali_1-1718041592367.png

 

Please mark my answer Correct/Helpful

Regards,

Sid