- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 10:38 AM
The requirement is to check to see if all the tasks are closed . Not sure what the script would be like:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 10:44 AM
This is the script I'm using:
ifScript();
function ifScript() {
var t = new GlideRecord('sc_task');
t.addNotNullQuery('order');
t.addQuery('request_item',current.sys_id);
t.addQuery('active',true);
t.query();
if(t.hasNext()){
answer = false;
}
else{
//Continue
answer = true;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 10:44 AM
This is the script I'm using:
ifScript();
function ifScript() {
var t = new GlideRecord('sc_task');
t.addNotNullQuery('order');
t.addQuery('request_item',current.sys_id);
t.addQuery('active',true);
t.query();
if(t.hasNext()){
answer = false;
}
else{
//Continue
answer = true;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 10:47 AM
Note: you probably don't need to "order" line - we are using this for controllling open/close of tasks auto-generated by the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 10:49 AM
Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 02:48 PM
What about ad-hoc tasks? I can't seem to make it work even though it is tied to the RITM number. Your query works just fine for a workflow created task.