Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

flow design on incidet table

saini123
Tera Contributor

Hi,

my requirement is when we select the assignment group on the incident table, it should create incident task for each memebr in that assignent group. I have created the flow but its creating incident task for all the users

(function execute(inputs, outputs) {
    var groupmember = new GlideRecord('sys_user_grmember');
    groupmember.addquery('group',inputs.assignmentgroup);
    groupmember.query();
    while(groupmember.next())
    {
        var incidenttask = new GlideRecord('incident_task');
        incidenttask.initialize();
        incidenttask.incident = inputs.incidentNumber;
        incidenttask.short_description='this inicdnt task is for '+inputs.incidentNumber;
        incidenttask.insert()
    }
 
can someone point me in right direction. Thanks
0 REPLIES 0