The Zurich release has arrived! Interested in new features and functionalities? Click here for more

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 ?

jennyjenny
Kilo Contributor

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

6 REPLIES 6

jennyjenny
Kilo Contributor

Hi,



Thanks for your reply,



I need to have a report from sysapproval_approver table only.



Thanks,


Jenny


jennyjenny
Kilo Contributor

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