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.

MadhuriGudiseva
ServiceNow Employee
ServiceNow Employee

We talked about several options on how users in our Call Center can have quick access to certain KB articles.

We landed on making a script that will add a bookmark when a users is added to the Call Center Group.

Here is a sample of that code that will only run 'on change' for the call center group

var grpm = new GlideRecord('sys_user_grmember');

  grpm.addQuery('group',current.sys_id);

  grpm.query();

  while (grpm.next()) {

      var chk = new GlideRecord('sys_ui_bookmark');

      chk.addQuery('title','EscalationWorkflow');

      chk.addQuery('user',grpm.user);

      chk.query();

      if (chk.getRowCount() < 1) {

              gs.addInfoMessage('User: ' + grpm.user.getDisplayValue() + " Escalation Bookmark created " );

              var p = new GlideRecord('sys_ui_bookmark');

              p.initialize();

              p.title = 'EscalationWorkflow';

              p.user = grpm.user;

              p.order = 999;

              p.url = 'kb_knowledge.do?sys_id=09558ce7554fa90df865xxxc2f7351&sysparm_record_target=kb_knowledge';

              p.image = 'images/icons/disputes.gif';

              p.icon = 'icon-view color-red';

              p.insert();

              }

      }

Version history
Last update:
‎12-17-2014 02:04 PM
Updated by: