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:08 AM
Hello,
I think the best way to do this is via a custom report:
http://wiki.servicenow.com/index.php?title=Custom_Chart_Rendering#gsc.tab=0
This way, instead of writing data to a record(s), you can generate two summary sets (one for each kpi to mesure) and display them as a lineplot over each other (within one plot).
Hope this helps.
Greetings
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:11 AM
you can report on group approval table where you can get change record number, group
but it wont give you exact count if you have used roll back in workflow
so you can change above new field to string and put the group name against the count, whenever needs an update you can inceremnt the counter against the group in the string field.
this can be achievable by string manipulations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:20 AM
Hi ,
Could you please help me in the code, how to take from the Group Approval .
Thanks,
Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:27 AM
this is the group approval table name
sysapproval_group
On this group you will find one record per group approval, you can put same kind of business rule here as i have updated
you can use JSON there to store data in the string field