Count number of approval
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2024 07:53 PM
hi. i'm trying to determine how to determine number of approval in a REQ. what we are trying to achieve is, in requests with more than 1 approver, the ticket will auto cancel if there's no approval by approver 1 after a certain time.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2024 10:32 PM - edited ‎07-17-2024 10:34 PM
Hi @Hafila Hatta ,
Please try the below in background script:
var reqsysID = 'ea87553b831b0210e1c15d10feaad36a'; //sysID of REQ record
var countAppr = 0;
var approverTab = new GlideRecord('sysapproval_approver');
approverTab.addQuery('sysapproval', reqsysID);
approverTab.query();
while(approverTab.next()){
countAppr ++;
}
gs.info('Total Count of Approval Records: '+ countAppr);
Result:
*** Script: Total Count of Approval Records: 3
Mark this as Helpful / Accept the Solution if this helps
----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.
Mark this as Helpful / Accept the Solution if this helps.