Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Display RITM variable on Appoval form from service portal for end User

SravaniP7164971
Tera Contributor

Hello community,

here i have admin role, so that i can see the ritm variables from Approval form from serviceportal

when the end user opend approval form, he cant see ritm number and variables
how to fix this?

here my requirement is to display ritm number and variables to the end user for Approval form

please help me with this.

 

thank you in advance.

10 REPLIES 10

he want to see from Approval form also because in our workflow we have to send a approver request for end user to accept the solution

@SravaniP7164971 

didn't get your point.

End user will raise request and he/she will be the approver?

but why?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

or please let me know if the user is having only snc_internal role
does he able to see the ritm variables from Approval form

@SravaniP7164971 

I am not convinced with the business requirement.

Please check the ACLs and debug using access analyzer

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Naveen20
ServiceNow Employee

Try this acl based fix @SravaniP7164971 

 

The cleanest solution is creating ACL rules so approvers can naturally read the RITM and its variables — no widget customization needed.

Step 1: Create ACL on sc_req_item (Read)

Navigate to: System Security > Access Control (ACL) > New

Field Value
Type Record
Operation Read
Table Requested Item [sc_req_item]
Role Leave empty

Script condition:

 
 
javascript
(function() {
    var gr = new GlideRecord('sysapproval_approver');
    gr.addQuery('sysapproval', current.sys_id);
    gr.addQuery('approver', gs.getUserID());
    gr.addQuery('state', 'requested');
    gr.query();
    return gr.hasNext();
})();

Step 2: Create ACL on sc_item_option_mtom (Read)

Same setup, but for the variables join table:

Field Value
Type Record
Operation Read
Table sc_item_option_mtom

Script condition:

 
 
javascript
(function() {
    var gr = new GlideRecord('sysapproval_approver');
    gr.addQuery('sysapproval', current.request_item);
    gr.addQuery('approver', gs.getUserID());
    gr.addQuery('state', 'requested');
    gr.query();
    return gr.hasNext();
})();

Step 3: Create ACL on sc_item_option (Read)

Field Value
Type Record
Operation Read
Table sc_item_option

Script condition:

 
 
javascript
(function() {
    // Trace back to RITM through mtom
    var mtom = new GlideRecord('sc_item_option_mtom');
    mtom.addQuery('sc_item_option', current.sys_id);
    mtom.query();
    if (mtom.next()) {
        var gr = new GlideRecord('sysapproval_approver');
        gr.addQuery('sysapproval', mtom.request_item);
        gr.addQuery('approver', gs.getUserID());
        gr.addQuery('state', 'requested');
        gr.query();
        return gr.hasNext();
    }
    return false;
})();