Reference field to show inactive users for catalog item and assoc. tasks

Blair5
Tera Guru

I found a discussion regarding inactive users being shown on a catalog item. --> Reference field not showing inactive users for our asset team

 

I'd like to show the inactive users on the catalog item (Offboard a user) and all subsequent tasks. The discussion I found addresses catalog item part, but not the TASK part. Does anyone have any ideas?

1 ACCEPTED SOLUTION

on the existing br you only need to modify ONE line.. find the if line that kicks it off and change it to



if (!gs.hasRole('user_admin') && !gs.hasRole('view_inactive_user') && (current.getEncodedQuery().indexOf('sys_id>')== -1))



<this adds the encoded query requirement to it>



then just add the ref qualifier to ANY reference field you want to show disabled users of   sys_id>''


View solution in original post

26 REPLIES 26

A lot depends on your system and how you do tasks/items/requests..



the easiest path is if the variable and the request requested for are always the same <in our case this is true>


just add the field.. request.requested_for to the form.. and set it to read only... you are done.



if OTOH the request requested for and the variable are different.. go to the workflow and in the catalog task item.. add the variable for requested for to the task.


Maybe it is a problem with the field type.   We are using a list collector against sys_user and need to be able to pull in multiple inactive users.   I added the reference qualifier and it works, but once it is on the item view - all the names have disappeared for the typical end user.   I can't figure out why they show on the catalog view, but not the item and the task.


Hi Blair,

 

Greetings !!!

 

Since this solution worked for you, request your help on this please. 

I am working on a similar requirement and I have made required changes in the BR. However, I could not figure out what exactly we have to do as a part of following line in randrews' response. 

"add this as a reference qualifer... sys_id>''

Could you please guide me what changes need to be done in the reference qualifier of the reference field? Would appreciate your response on this please.

Thanks & Regards,

Gulzar Manuja 

Shirali
Tera Contributor

Hi Raymond,



I tried the same code as mentioned by you.



if (!gs.hasRole('user_admin') && !gs.hasRole('view_inactive_user') && (current.getEncodedQuery().indexOf('sys_id>')== -1))



when i log in as some itil user, It worked and now in requested for field it shows inactive users as well.



However, when i select any inactive user on my catalog item, information icon besides the variable shows record not found and it is not auto populating the related values for Requested for manager, requested for email etc. Could you please help me with this.


Hi randrews,

Hope you are doing well. 

I am working on a similar requirement and I have made required changes in the BR. However, I could not figure out what exactly we have to do as a part of following line in your response. 

"add this as a reference qualifer... sys_id>''

Could you please guide me what changes need to be done in the reference qualifier of the reference field? Would appreciate your response on this please.

Thanks & Regards,

Gulzar Manuja