How to get a to report against the total rejection count on the change request table, as well as being able to report how many times an approval group rejected on the approval [sysapproval_approver] table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 12:30 AM
Hello Team,
I trying to get to report against the total rejection count on the change request table, as well as being able to report how many times an approval group rejected on the approval [sysapproval_approver] table .
For the rejection count :
- I have created a new field called Rejection Count to capture the count that how many times the count has been rejected .
- I have written the business rule as below
Condition : current.state.changes() && current.state=='rejected'
Script :
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sd = new GlideRecord('change_request');
if(sd.get(current.sysapproval)) {
//sd.u_rejection_count++;
sd.u_rejection_count++;
sd.work_notes='Rejection Count : '+sd.u_rejection_count;
sd.update();
}
})(current, previous);
Now the rejection count is calculating how many times the chage is rejected .
But the user is requesting how many times an approval group rejected on the approval [sysapproval_approver] table .
I am not able to get report on this requirement .
anybody help on this.
Thanks,
Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:47 AM
Hi,
Thanks for your reply,
I need to have a report from sysapproval_approver table only.
Thanks,
Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 02:27 AM
I have used the code like below
Condition : current.group.approval.changes() && current.group.approval=='rejected'
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sd = new GlideRecord('change_request');
if(sd.get(current.group.approval)) {
//sd.u_rejection_count++;
sd.u_rejection_count++;
sd.work_notes='Rejection Count : '+sd.u_rejection_count;
sd.update();
}
})(current, previous);
Now even the count also not increasing, Could you please check any one on this.
Thanks,
Jenny