Issue with cross-domain approvals

peterwigham
Kilo Expert

Hi all,

 

I'm busy working on a requirement for cross-domain approvals; the approvals for this change process require approval to be sought from several different domains that essentially move up and down the domain hierachy chain.

 

We are using domain separation within our instances and currently have a hierachy of:

 

- BTLG (internal to our company)

- Pan-London (external domain, child domain to BTLG)

> WCC (external sub-domain, child to Pan-London)

> RBKC (external sub-domain, child to Pan-London)

> H&F (external sub-domain, child to Pan-London)

 

So, BTLG is the main domain, underneath this is Pan-London and this contain the three other domains.

 

All internal employees are in the BTLG domain whilst the Pan-London employees are spread amongst the domains of WCC, RBKC and the H&F domains.

 

We have a workflow in place called 'Comprehensive Change LF' that includes four approval group steps; Change Manager Approval, CAB Aproval: CAB1, Client CAB Approval: CAB2, CAB Aproval: CAB3. All of these steps require approval from BTLG users apart from Client CAB Approval: CAB2 which requires aproval from a user group consisting of users across the three Pan-London sub-domains.

 

When testing this I've noticed that when I log this with a user in the WCC domain if there are no WCC users within the groups from the same user domain as the user logging the record, the step is skipped and no approval is requested. I understand why this is however, we need to find a way to get approvals to be generated back up the hierachy to the BTLG level.

 

I've set up the relevant domain 'Contains' and 'Visibility' for the Pan-London sub-domains so that they can all see one another however it would seem that the approvals will not be generated back up to the BTLG users. Has anyone ever has to create a workaround for this using domain 'Contains' and 'Visibility' or within the workflow.

 

Any help or suggestions would be hugely apreciated.

 

Cheers,

PW

10 REPLIES 10

Jon G1
Kilo Sage

For those who come across this as one of the top google search results years later as I have, this is now ServiceNow's recommended workaround:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0791754

---

Resolution

This is the expected behavior, however to change this:

Locate script include: "WorkflowApprovalUtils" (/sys_script_include.do?sys_id=0360b36d0a0a0b260a89dfec60c339c4)
In method "getMembersOfGroup" replace query with queryNoDomain, see below:

   getMembersOfGroup: function(groupID) {
      var ids = [];
      if (!groupID)
         return ids;

      var gr = new GlideRecord('sys_user_grmember');
      gr.addQuery('group', groupID);
      gr.addNotNullQuery('user');
      gr.addQuery('user.active', true);
////////////////////////////////////// 
      gr.queryNoDomain();
//////////////////////////////////////
      while (gr.next()) {
         ids.push(gr.getValue('user'));
      }

      return ids;
   },

I added the comment lines for emphasis.