Dynamic report filter using current

johnhughes1
Mega Contributor

The report calls for a list of releases that do not have associated changes.

I've created a report filter as:

Sys ID does not contain javascript:RefQualFilter().findReleaseWithChangeReq(current)

The intention of script include is to gather all releases from our many-to-many change to release relationship and push them back to the report filter.

The issue is that "current" throws a not defined error.   Any advice would be greatly appreciated on how to pass current from a report filter?

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

There shouldn't be any current if it is getting called from report. Also if the script include is class based, then new operator is missing for object creation.


View solution in original post

7 REPLIES 7

Kalaiarasan Pus
Giga Sage

There shouldn't be any current if it is getting called from report. Also if the script include is class based, then new operator is missing for object creation.


Kalai,   appreciate the reply.   Your exactly right, I don't need current as I only need to pass all release sys_ids back to the report for the filter.


Abhinay Erra
Giga Sage

You will not have access to current. here and your script include should be a client callable.. Post your script include code here.


Abhinay,   here's the filter and script include.


Report filter: Sys ID is not javascript: new MWRefQualFilter().MWfindReleaseWithChangeReq()


 


Client Callable Script include:



var MWRefQualFilter = Class.create();


  1. MWRefQualFilter.prototype = {

      initialize: function() {


      },


      MWfindReleaseWithChangeReq: function() {


                    var answer = [];


                      var gr = new GlideRecord('u_m2m_change_requests_releases');


                     


                      gr.addQuery('u_change_request.state', '<',2);     // get all change requests considered 'open'


                      gr.query();


         


      while (gr.next()) {  


answer.push(gr.getValue('u_release'));


      }


      return answer;  


                      },


                     


      type: 'MWRefQualFilter'


};