"No Preview Available" - How to allow approvers to view the formatted requested item?

jamesmcwhinney
Giga Guru

I have created a catalog item that is fairly complex with quite a few fields (variables) on it.

Currently, when our approvers click the link to view the service catalog request and all of the requested items, they cannot open up the requested item to see it in all of its glory.   Instead, they see "No Preview Available"

All they can do is click on the drill down summary, which is very difficult to read since there is no formatting or layout to it. =(

NoPreviewAvailable.jpg

I know I can try to create a complex approval email with all of the fields in it, but this creates a maintenance nightmare...

Can anyone suggest a better way to allow the approvers to see the (fully formatted) requested item?

Thanks in advance,

- James

1 ACCEPTED SOLUTION

jamesmcwhinney
Giga Guru

I have a HI ticket open but they are still looking into it.



For now, I have come up with a temporary solution via ACLs.


I don't know if this is the right way to address the problem or not, but it seems to do the job for now.


I have created two ACLs and a script include:



Script Include:


Name: myWorkflowTools


Script:


var myWorkflowTools = Class.create();


myWorkflowTools.prototype = {


      initialize: function() {


      },


  isUserAnApproverOfReq : function (sysid,userid){


  var isApprover = false;


  var appr = new GlideRecord('sysapproval_approver');


  appr.addQuery('sysapproval', sysid);


  appr.addQuery('approver', userid);


  appr.query();


  if(appr.next())


  {


    isApprover = true;


  }


  return isApprover;


},


      type: 'myWorkflowTools'


};





ACL #1:


Table: sc_req_item


Operation: read


Script:


var wfTools = new myWorkflowTools();


if(wfTools.isUserAnApproverOfReq(current.sys_id,gs.getUserID())){


answer = true;


} else {


answer = wfTools.isUserAnApproverOfReq(current.request.sys_id,gs.getUserID());


}



ACL #2:


Table: sc_request


Operation: read


Script:


var wfTools = new myWorkflowTools();


answer = wfTools.isUserAnApproverOfReq(current.sys_id,gs.getUserID());


View solution in original post

10 REPLIES 10

sylvia_hope
Kilo Contributor

I needed this too and came across this post that worked for me:

 

https://community.servicenow.com/community?id=community_question&sys_id=f17f3ea9db58dbc01dcaf3231f96...

 

var approval = new GlideRecord('sysapproval_approver');

 

approval.addQuery('sysapproval.sys_id', current.sys_id);

 

approval.addQuery('approver.sys_id', gs.getUserID());

 

approval.query();

 

var answer = approval.next();