Popup window to choose from members of assignment group

wiltonr
Giga Contributor

I have a UI Action that does a couple of things - assign a ticket to a particular assignment group and change the status of the ticket.   One requirement is that Assigned To cannot be left blank though.   Currently I'm just throwing up an alert to say assigned to must be populated, but if the current assignment group and assigned to are already filled in with something other than the one it needs to be, then that check to see if assigned to is empty doesn't really matter.   We want the user to be able to click the UI action from the form and then be prompted with a dialog box to select the users of that assignment group.   We are currently doing a similar thing by using GlideDialogWindow to backfill the assignment group.   So when the assigned to is populated, if the user is a member of more than one assignment group, we get a popup dialog to choose which assignment group and then it puts that into the assignment group field.   I want to basically do the opposite though.   The UI action says which specific assignment group I want to use, but I want a popup to give a list of its members and let the user select and populate the field.   The Backfill Assignment Group was written by our implementation partner and I can't wrap my head around the UI Page enough to figure out how to reverse it.

7 REPLIES 7

Makosko
Tera Expert

you need a reference qualifier on the assigned_to field as follows:



javascript:RQFilterAssignedToByAssignmentGroup()



function RQFilterAssignedToByAssignmentGroup() {


      if (current.assignment_group.nil()) {


              return "active=true";


      } else {


              var output = [];


              var gr = new GlideRecord("sys_user_grmember");


              gr.addQuery("group", current.assignment_group.toString());


              gr.addQuery("user.active", true);


              gr.query();




              while (gr.next()) {


                      output.push(gr.user.toString());


              }


              return "sys_idIN" + output.toString();


      }


}


wiltonr
Giga Contributor

Should this be creating a pop-up window?   What I need is to be able to have a UI Action to change the assignment group and then pop up a window that will have radio buttons to select which user in that assignment group that you want to choose.


first question , is the pop up page with choices of assignment group really necessary ? Can't you have a onchange script for assigned_to field and if the users changes it, pop up just an alert saying "please choose the corresponding assignment group" ?



if the answer to the above question is 'No', you can make use of the onchange script + reference qualifier given by Maros Takac with bit of tailoring as per your need


keep the dialog box and make it load the same f in a different view, called "Forward" for instance ? the form would have two fields -> Assignment Group and Assigned To ( with my reference qualifier applied to it )



hope that helps ?