- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 01:06 AM
Hi,
I have a requirement to auto-populate the manager name of (Is owned by-field) of CI in cmdb_ci_win_server table in approval activity in workflow. I used the below script but did not work. Could someone please help me?
The filed value of manager which is dot walked from is owned by is in below screenshot.
How can I trigger approval of the manager name if the server in workflow approval activity?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 01:29 AM - edited 08-09-2023 01:30 AM
hello there is a error in your script
var answer = []; //define array
var ser = new GlideRecord("cmdb_ci_win_server");
ser.addQuery("sys_id",current.variables.serverList4);
ser.query();
if(ser.next())
{
answer.push(ser.u_is_owned_by.manager); //replace to this
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 03:08 AM
are you sure that group has manager and that manager is active, not locked out and has email field populated?
no need to query you can directly dot walk
Also you are using wrong field name it;s manager
use this
answer = [];
answer.push(current.variables.serverList4.u_is_owned_by.manager.toString());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 01:29 AM - edited 08-09-2023 01:30 AM
hello there is a error in your script
var answer = []; //define array
var ser = new GlideRecord("cmdb_ci_win_server");
ser.addQuery("sys_id",current.variables.serverList4);
ser.query();
if(ser.next())
{
answer.push(ser.u_is_owned_by.manager); //replace to this
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 03:03 AM - edited 08-09-2023 03:08 AM
Hi @Harish KM
I used the same script as you mentioned but approval user of infrastructure is supported by manager name is triggering but I want "Is owned by" manager name in the approval user. Could you please?
The approval user is triggering the manager name of "infrastructure is supported by" manager name instead of "is owned by" manager name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 03:08 AM
Hi please check what value your getting here?
current.variables.serverList4 // is this sysid of record?
u_is_owned_by // is this the field name referenced to group table? then manager name will be returned since we are dot walking to group table and selecting manager field
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 03:08 AM
are you sure that group has manager and that manager is active, not locked out and has email field populated?
no need to query you can directly dot walk
Also you are using wrong field name it;s manager
use this
answer = [];
answer.push(current.variables.serverList4.u_is_owned_by.manager.toString());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader