The CreatorCon Call for Content is officially open! Get started here.

Wrong Routing of Record Producers

Abdul333
Tera Contributor

Hello All,

 

Users from different Organization accessing wrong Record Producer in Service Portal.(like Japan User creating ticket for Canadian Record Producer).

This is happening Sporadically, we are unable reproduce the issue.

We are having OOB module called "User Criteria ". We configured User's Organization in it so that based on the users location it will the Record Producers.

 

Abdul333_0-1695105454882.png

And we are having one related list called "Available for"--based on Organization.

Abdul333_3-1695106190692.png

using below user criteria script

 

(function isAllowed(){
var gr = new GlideRecord("sys_user");
 
if(gr.get(user_id)){
if( gr.u_market.u_organization.name  ==  "Japan") {
return true;
}
}
return false;
})();
 
Please check and let me know why this issue is happening and how we can fix it.
 
 
Thanks,
Abdul

 

 

1 REPLY 1

Vishal Birajdar
Giga Sage

Hi @Abdul333 

 

I think "return false" should be after second if.

 

(function isAllowed(){
var gr = new GlideRecord("sys_user");
 
if(gr.get(user_id)){
if( gr.u_market.u_organization.name  ==  "Japan") {
return true;
}else {
return false;
}
 
}
})();
 
 
Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates