How to limit no of users in a call in on call scheduling

SakshiBagal
Tera Contributor

I have a requirement to limit no of users in on call scheduling, Currently, multiple users are able to join call. but I have a requirement to allow call between only two users, 1st user should always be logged in user and 2nd user logged in user will select in slushbucket.

I have written below code to select and add logged in user's mob no in slush bucket but it is showing undefined.

 

Script Include

getNumber: function ()

{

var gr = new GlideRecord('sys_user');

gr.get(gs.getUserID());

return gr.mobile_phone.toString();

}

 

Client script

addLoadEvent function(){

slush.clear();

var  ga= new GlideAjax('Script Include Name');

ga.addparm('sysparm_name', 'getNumber');

ga.getXML(processResponse);

}

function processResponse(response)

{

var answer=response.responseXML.documentElement.getattribute("answer");

slush.addRightChoice(answer);

}

 

Using above script I m able to add number but it is showing undefined instead of number.

 

 

 

 

2 REPLIES 2

Shubham_Jain
Mega Sage

@SakshiBagal  Can you try with this -- 

 

addLoadEvent(function() {
    var ga = new GlideAjax('Script Include Name');
    ga.addParam('sysparm_name', 'getNumber');
    ga.getXML(processResponse);
});

function processResponse(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer) {
        slush.addRightChoice(answer);
    } else {
        console.log("No mobile number found.");
    }
}

 

Or Try using in existing script that you shared: 

 

var answer = response.responseXML.documentElement.getAttribute("answer");

 

 

-========

 

Alternative: Use Assignment Group Logic

If your use case is tied to incident or task assignment, consider:

  • Creating a custom assignment group with only two members.
  • Using Business Rules or Flows to enforce selection logic.

 

 

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain


Thank you Shubham for your response.

I tried above script, still it showing undefined in slush bucket.