Reference qualifier of a Catalog variable to show Assets assigned to the user is not working in the service portal

Krishna137
Tera Contributor

We have a catalog item where "Computer Name" is a variable which refers to cmdb_ci_computer table. We have the reference qualifier to get only those non-retired asset which are assigned to the user. It is working fine inside the application- User is able to see all the assets assigned to him- but it is NOT working in the Service Portal- Its showing "No Matches Found" in service portal.

javascript:'hardware_status!=retired^assigned_to='+current.variables.username

 

Please NOTE- When we impersonate a user and check in service portal its showing the computers assigned to him. But when he log in and check is not listing the computers

4 REPLIES 4

Sushant Kadam1
Kilo Guru

Hi Krishna,

Try using script include in advanced reference qualifier.

Glide your cmdb_ci_computer table and write query as you specified in question and fetch all the non-retired assets at client side.

 

Please mark correct/helpful if it solves your issue.

Regards,

Sushant

snowolper
Tera Expert

This was a very helpful article.

https://community.servicenow.com/community?id=community_question&sys_id=b3af326ddb58dbc01dcaf3231f96...

"I changed this back to a reference field and added the following:

Variable attributes: ref_qual_elements=current.variables.requested_for

Ref qual: javascript: 'assigned_to='+current.variables.requested_for

Worked fine!"

Please list and Helpful it helped:)

RAHUL Khanna1
Mega Guru
That's Strange....for testing purpose can you hard a sys id of a perticular user and check it once.

Yea, this worked for me perfectly for my case. I'd recommend testing it by creating a new Catalog Item and adding the fields called: 1. Requested For (reference field) -> sys_user 2. Assigned To (list collector) -> alm_hardware (or whereever your info is). Let it default it the naming convention and test.