How to auto-populate a newly added 'Server Owner' field based on 'Server Name' selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 12:23 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 12:32 AM
Hi @Chandrakant4 ,
You can use reference type for variable and select required table
Use reference qualifier in it..
like this
javascript:'owned_by='+current.variables.requested_for.sys_id
Kindly let me know if any other help required help from me
Chandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 10:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 10:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 02:37 AM - edited 07-01-2025 02:38 AM
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.
Chandan