How to trigger approval to Server Owner if Requestor and Server Owner are different

Chandrakant4
Tera Contributor

Hi Community,
I'm new to ServiceNow development and need help with an approval requirement for a Service Portal catalog request.

Here’s the scenario:

  • The request form has two fields: Server Name and Server Owner. The Server Owner is auto-filled based on the selected Server Name.

  • After the form is submitted, if the Requestor and the Server Owner are different, an approval should be sent to the Server Owner.

  • Otherwise, the request should go through the regular group approval as per the existing workflow.

Could you please guide me on how to implement this logic?

  • Should I use Flow Designer or Workflow?

  • How can I compare the values of 'Requested For' and 'Server Owner' after submission and trigger the approval?

Any help or example would be really appreciated!

Thanks in advance,
Chandrakant Patil

5 REPLIES 5

harishk07
Tera Expert

Hi,

This is a common use case in scenarios involving CI-based approvals.

Here’s one way to approach it:

 

Goal is to trigger an approval to the Server Owner if the requestor and server owner are different.

 

  1. Make sure the Server CI has the "Owned by" field populated
    This field (cmdb_ci.owned_by) should ideally point to a user record.

  2. Use Flow Designer (Recommended):

    • Trigger: When the request or task is created

    • Condition: current.requested_for != current.cmdb_ci.owned_by

    • Action: Use Approval - User action

      • Approver:

         
        current.cmdb_ci.owned_by
  3. Optional – Add fallback logic
    If owned_by is empty, route the approval to a default group to prevent failure.

 

Best regards,
Harish Kothandapani

Best Regards,
Harish

✔️ Kindly mark as Helpful / Accept Solution if this answered your question

Ankur Bawiskar
Tera Patron
Tera Patron

@Chandrakant4 

you can use Flow Designer for this as many customers are moving towards low-code, no-code approach

1) please use "Get Catalog Variables" flow action

2) then use IF logic and compare the Requested for from RITM->REQ and the Server Owner

3) If different then send approval to Server Owner

4) In the ELSE logic use Group Approval

I will suggest to start from your side and it will be learning for you as well.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar @harishk07 

Thanks for the suggestion!

This catalog item is currently using Workflow (Catalog Workflow Router) instead of Flow Designer. So, I’m a bit unsure about the best approach here.

I need to implement logic where an approval should be triggered to the Server Owner if the Requested For and Server Owner are different.

Since it's using a workflow, what should I do in this case?
Should I modify the existing workflow or create a custom one specifically for this item?

Appreciate any guidance!

Thanks,
Chandrakant Patil

Chandrakant41_0-1751352430796.png

 

@Chandrakant41 

you can use IF activity and use this script

Output of yes goes to User approval (Server Owner)

Output of no goes to Group Approval

I assume you know how to include approvers in workflow activity

answer = ifScript();

function ifScript() {
    if (current.variables.server_owner == current.request.requested_for)
        return 'yes';
    else
        return 'no';
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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