User has got process coach access still user is unable to access the application enhancement form

Ashwini Sawant2
Tera Contributor

Hello All,

 

We have an form - Application Enhancement Request form, in which there is available for criteria in which one criteria is below -

AshwiniSawant2_0-1703175513305.png

And below is the script for this - 

answer = answers();
function answers(){
    var usr = gs.getUserID();
    var relPerson = new GlideRecord("cmdb_rel_person");
    relPerson.addQuery('type', gs.getProperty("PQ.cmdb_rel_person.type.process_coach"));
    relPerson.addQuery('user', usr);
    relPerson.query();
    if (relPerson.next()) return true;
    else return false;
}
 
User have got access to process coach but still he is unable to see the catalog item - Application Enhancement Request form.
 
Kindly suggest on this. Thanks
2 REPLIES 2

AshishKM
Kilo Patron
Kilo Patron

Hi @Ashwini Sawant2 ,

As we can see there are 3 user criteria configured, are you sure other two also returning the answer = true.

You can remove all and add one by one and test to know which one is causing issue.

 

-Thanks,

AshishKMishra


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Susan Britt
Mega Sage
Mega Sage

Try to do an encoded query instead of the two addQuery statements, something like the below:

 

var usr = gs.getUserID();
var perType = gs.getProperty('PQ.cmdb_rel_person.type.process_coach');
var relPerson = new GlideRecord('cmdb_rel_person');
relPerson.addEncodedQuery('type='+perType+'^user='+usr);
relPerson.query();
...