Reference Qualifier not filtering User picker by Department in Catalog Item

JGuerrero0323
Tera Expert

Hi Community,

I'm currently working on a Service Catalog Item where I have two variables:

  • Business Unit (Reference to business_unit)

  • Model User (Reference to User [sys_user])

I want Model User to show only users that belong to the department selected in the Business Unit variable.

I tried adding a Reference Qualifier Script on Model User with this code:

function qualifier(current) {
  var item = current.request.item;
  var department = item.variables.business_unit;

  if (department) {
    return 'department=' + department.toString();
  }
  
  return '';

But it's not filtering the list of users — I’m still seeing all users instead of just the ones in the selected department. 

 

 

  • I also created a Script Include and a Catalog Client Script in an attempt to filter this, but it’s not working either.

  • I'm happy to share that code if it's helpful — just let me know.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@JGuerrero0323 

try this

javascript:'department.business_unit=' + current.variables.business_unit;

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@JGuerrero0323 

try this

javascript:'department.business_unit=' + current.variables.business_unit;

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader