- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 08:55 PM
We have a scenario to handle multiple set of approvals on a RITM.
From a catalog form we are dynamically allowing user to a add a row with 3 columns
Column 1: Business Service (reference field)
Column 2: Dataset
Column 3: Access Level (3 radio buttons: Read/Write/Delete)
I have created a UI Page with Add/Delete Row functionality.
Finally am able to get the selected Business Services into an array on a workflow.
Now, for each Business Service there are 3 users (Application Owner, Custodian1 & Custodian2) approvals to be generated.
If 10 Business services selected on a form, 10 sets of approvals to be generated. All sets should be handled individually, where if one approves remaining 2 should be set as 'No Longer Required'
answer = [];
var app = current.variables.services; //
var gr = new GlideRecord('cmdb_ci_service');
gr.addQuery('sys_id', 'IN', app.split(','));
gr.query();
while(gr.next()){ | |
answer.push(gr.getValue('u_ao')); // Application Owner | |
answer.push(gr.getValue('u_c1')); // Custodian 1 | |
answer.push(gr.getValue('u_c2')); // Custodian 2 |
}
It's code on Approval User activity. It's generating all necessary approvals. But, one approved all remaining setting to either 'No Longer Required' or remaining in 'Requested' state.
Kindly help me out how can we handle the approvals set basis in my scenario.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 09:39 PM
I've done this by using RUN SCRIPT and Business Rule.
1. RUN Script - Generating approvals manually by initializing a GlideRecord on sysapproval_approver table.
2. Business Rule (after, update, on sysapproval_approver) - on approval verifying for the other approvals on same set and setting those to 'No Longer Required'. On every approval getting the count of all approvals on sc_req_item to get the info of approved, rejected, no longer required. Based on that am setting the approval, stage & state value of RITM.
Thank you !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 09:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 09:36 PM
Thank you for your response Harish, that would possible if we have single set of approvals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2017 02:42 AM
Hi Ravinder,
When you say 10 sets, I doubt if you can use approval user activity. It consider all users as single set but there is an option to wait for approval based on script.
You can set approval states to approved or rejected here but again I am not sure if you can differentiate each sets of yours
Your requirement would have been simple if you are able to add the 3 users in a group and use the approval-group activity as this will group the approvals based on 10 different sets
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 09:35 PM
Alikutty Karupamveetil, Thank you for your response. Yes, it's not differentiating the sets.
Adding the users to group is not recommended, so I couldn't go with that approach.