Query against table incident restricted by domain values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 12:54 AM
Hello,
I am getting this error message "Query against table incident and table service_offering restricted by domain values" when I run a background script to autoclose an incident. Why does this happen? How to resolve this?
This is the background script I have written.
checkdeliveredtask('incident','state=5',1,'xy');
function checkdeliveredtask(table,query,days,domaine){
var pn=0;
var dmn=new GlideRecord('service_offering');
dmn.addQuery('GOTOsys_domain.nameLIKE'+domaine.name);
dmn.queryNoDomain();
dmn.setLimit(1);
dmn.query();
while(dmn.next()){
var dt= new GlideRecord(table);
//dt.addDomainQuery(dmn);
dt.addQuery(query);
dt.addQuery('sys_domain.name='+domaine.name);
//dt.addQuery('active=true^ORactive=false');
dt.query();
gs.print("incident number:"+number);
while(dt.next())
{
var d=dt.u_delivered;
var day =new GlideDateTime(d);
switch(day.getDayOfWeek())
{
case 5://5
pn= parseInt(days)+2;
break;
case 4:
pn=parseInt(days)+2;
break;
default:
pn=parseInt(days);
}
//Counting days from day ticket is delivered
if(dt.u_delivered < gs.minutesAgo(pn))
{
dt.state = 3;
gs.print("status is:"+state);
dt.update();
}
}
}
Regards,
Reeba

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 06:43 AM
Does your user account have access to the records in that domain?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 07:31 AM
Hi Brad,
Yes my account has access to the records in that domain. I tried this global domain also, there also I got the same message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2018 10:55 PM
Hi Reeba,
Can you please post the solution here if you get any