RITM Group Approval on Workflow

peterwigham
Kilo Expert

Hi guys,


I was wondering if anyone else has done this and could point me in the right direction. I have a workflow that runs against the Requested Item table and requires a Group Approval. The group that should have to approve this is the group linked to the Item through the 'Approved By Group' value however it does not seem like I can find the Approved By Group value in the tree picker or any way in which to get the approval created against this group. Clearly I'm missing something - can anyone advise me what?


As always, I appreciate your help.

PW

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

The "Approved By Group" related list is pointing to a separate table, so you would need to use a bit of script to get to the groups.   Select the "Advanced" checkbox on the Activity Properties form of the Group Approval and add the following to the "Additional groups script" field:



var answer = (function() {


  var groups = [];


  var gr = new GlideRecord("sc_cat_item_app_group");


  gr.addQuery("sc_cat_item", current.getValue("cat_item"));


  gr.query();


  while (gr.next()) {


        groups.push(gr.getValue("approval_group"));


  }


  return groups;


})();



The script will check the "sc_cat_item_app_group" table for any and all approval groups for that particular catalog item.


View solution in original post

3 REPLIES 3

Jim Coyne
Kilo Patron

The "Approved By Group" related list is pointing to a separate table, so you would need to use a bit of script to get to the groups.   Select the "Advanced" checkbox on the Activity Properties form of the Group Approval and add the following to the "Additional groups script" field:



var answer = (function() {


  var groups = [];


  var gr = new GlideRecord("sc_cat_item_app_group");


  gr.addQuery("sc_cat_item", current.getValue("cat_item"));


  gr.query();


  while (gr.next()) {


        groups.push(gr.getValue("approval_group"));


  }


  return groups;


})();



The script will check the "sc_cat_item_app_group" table for any and all approval groups for that particular catalog item.


jim.coyne - Thank you very much for your help on this. It's worked just as I'd hoped.


You are welcome