Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

for ServiceMapping, Is the saListCis function documented somewhere?

porthos
Tera Contributor

For ServiceMapping, Is the saListCis function documented somewhere?   What other parameters or abilities does it have?

Thanks,

PG

1 ACCEPTED SOLUTION
9 REPLIES 9

bernyalvarado
Mega Sage

Hi porthos, indeed, it's documented within your instance. It's a global business rule.



Thanks,


Berny


bernyalvarado
Mega Sage

It's code is something like this:



function saListCis(bsId) {


      var gr = new GlideRecord('svc_ci_assoc');


      gr.addQuery('service_id', bsId);


      gr.query();


      var prefix = '';


      var ids = '';


      while (gr.next()) {


              ids = ids + prefix + gr.getValue('ci_id');


              prefix = ',';


      }


      return ids;


}



The logic is the following:



Based on a given Business Service ID it goes to the table that hold the associations between a Business Service and its related CIs and retrieves the list of CIs associated to that Business Service in a comma concatenated string list.



Thanks,


Berny


bernyalvarado
Mega Sage

I hope this helps!