We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Catalog Workflow – How to route approval to Service Owner (Owned by on cmdb_ci_service)?

nameisnani
Mega Sage

Hi All,

I’m working on a catalog item workflow (table: sc_req_item) and need help with the approval logic.


🔹 Requirement (workflow only)

For a specific catalog item, the user selects a Business / Application Service (from cmdb_ci_service) through a catalog variable.

Before the request goes to the Librarian / fulfilment group, I need to add an Approval – User activity that:

  • Sends the approval to the Service Owner
  • The Service Owner is stored in the owned_by field on the cmdb_ci_service record
  • The selected service is stored in a catalog variable (reference to cmdb_ci_service)

So effectively:
approver = cmdb_ci_service.owned_by for the CI selected in the RITM.

🔹 Current design

  • Workflow runs on: sc_req_item
  • Variable holding the service: u_business_service
    • Type: Reference
    • Reference table: cmdb_ci_service
  • I am using an Approval – User activity with Advanced script
// Catalog item workflow (table: sc_req_item)
// Need to set approver = "Owned by" of selected Service CI
 
var serviceSysId = current.variables.u_business_service;
answer = '';
 
if (!gs.nil(serviceSysId)) {
    var svc = new GlideRecord('cmdb_ci_service');
    if (svc.get(serviceSysId)) {
        if (!gs.nil(svc.owned_by)) {
            answer = svc.owned_by.toString();  // Expecting this to be the approver
        }
    }
}




 

while doing testing - once request subimtted after line manager approval - is directly assigning to fulfillment group - not triggering approval for service owner 

 

 

please help me with this 

 

script modification

 
 
 

Screenshot 2026-02-26 121436.png

1 REPLY 1

Ankur Bawiskar
Tera Patron

@nameisnani 

is that user active and not locked out?

try this

-> declare answer as array and push sysId in it

var serviceSysId = current.variables.u_business_service;
answer = [];
 
if (!gs.nil(serviceSysId)) {
    var svc = new GlideRecord('cmdb_ci_service');
    if (svc.get(serviceSysId)) {
        if (!gs.nil(svc.owned_by)) {
            answer.push(svc.owned_by.toString());  // Expecting this to be the approver
        }
    }
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader