How to auto-populate a newly added 'Server Owner' field based on 'Server Name' selection

Chandrakant4
Tera Contributor

Hi Community,

I'm implementing a requirement in a Service Catalog item and need some guidance.

Here’s the scenario:

  • I'm adding a new field called 'Server Owner' just below the 'Server Name' field.

  • The 'Server Name' field is a reference to the cmdb_ci_computer table.

  • When a user selects a server, I want the 'Server Owner' field to auto-populate based on the owned_by field from the selected cmdb_ci_computer record.

I'm planning to create the 'Server Owner' variable, but I’m unsure of the best approach to auto-fill it:

  • Can this be achieved using a UI Policy, or is a Catalog Client Script + Script Include required?

  • If client scripting is the way to go, could someone please share an example for how to fetch the owned_by user and populate the reference field?

Thanks in advance for your support!

4 REPLIES 4

SD_Chandan
Kilo Sage

Hi @Chandrakant4 ,

You can use reference type for variable and select required table 

Use reference qualifier in it..

ChandanP_0-1751268691350.png

like this 

javascript:'owned_by='+current.variables.requested_for.sys_id

Kindly let me know if any other help required help from me 


Thank you
Chandan

Hi @SD_Chandan 

Thanks for the suggestion!

I used a different approach. I use auto-populate related list, and it worked as expected. Appreciate your help!

Thanks again,
Chandrakant Patil

Chandrakant4_0-1751304901228.png

 

Hi @SD_Chandan 

Thanks for the suggestion!

I used a different approach. I use auto-populate related list, and it worked as expected. Appreciate your help!

Thanks again,
Chandrakant Patil

 

Chandrakant4_0-1751304901228.png

 

Hi @Chandrakant4 ,
Yes Dot walk is also good approach

I though you want to populated all server which is own by user that's why I suggested reference qualifier.

 

Thank you
Chandan