Can we call script include from SLA filter condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 02:42 AM
Hi
Can we call script include from a SLA start condition using below?
javascript:newGetInSys().getinc();
I user the above method to call the script include function but it is not triggering from the SLA start condition.
I have verified the script and it is working in background script.
Thanks,
Neethu
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 02:57 AM
Yes,the script include return the sys id and i have added the filter condition sys id "contains" which didn't work and tried "is one of" it also not working.Client callable is true
It is not going inside the script include

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 03:00 AM
sorry for this question. may i know why are you calling the script include inside the sla ? can you please add your use case ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 03:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 04:00 AM
javascript: new GetInc().getsysID();
The script include is used to get the sys id of incident where previous assignment group is GroupName1 and current assignment group is GroupName2 or vice versa.This script is giving the sys id of incident when executing in backgroun script
Script Include:
var arr = [];
var ar = [];
var sys;
var gr = new GlideRecord('metric_instance');
gr.addEncodedQuery('definition=def_name^valueLIKEGroupName 1^ORvalueLIKEGroupName 2^end=NULL');
gr.query();
while(gr.next()){
//gs.log('Total Count: ' + gr.id );
sys= new GlideRecord('metric_instance');
sys.addEncodedQuery('definition=def_name');
sys.addQuery('id',gr.id);
sys.orderByDesc('start');
sys.setLimit(2);
sys.query();
arr.splice(0, 2);
while(sys.next()){
arr.push(sys.value.toString());
}
ar.splice(0, 1);
if((arr[0]=="GroupName 1" && arr[1]=="GroupName 2")||(arr[0]=="GroupName 1" && arr[1]=="GroupName 2"))
{
ar.push(sys.id.toString());
gs.log("*****************Success****************: " + ar);
}
}
}
}
return 'sys_idIN'+ar.join();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 04:05 AM
if you see my above screenshot, i used global prefix so can you use that as well in filter condition
would it be possible if you can add some screenshot of you script include and filter condition ?
eg:
sys_id | is one of | javascript: new global.<script include name>.<function name>