- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 11:01 AM
Is there a way to check if a task with a specific short description has been closed by using addQuery?
(function executeRule(current, previous /*null when async*/ ) {
// Prevents proceeding to the Qualified State from Screening state, if Tasks have not been completed, and approval has not been received.
if (previous.getValue('state') == '3' && current.getValue('state') == '-4') {
var grDemandTask = new GlideRecord("dmn_demand_task");
grDemandTask.addQuery("parent", current.getValue("sys_id"));
grDemandTask.addQuery("active", true);
grDemandTask.query();
if (grDemandTask.next() && current.getValue('approval') == 'approved' || current.getValue('approval') != 'approved') {
//Don't proceed
gs.addInfoMessage('Please Complete the Demand Tasks, and approval ');
current.setAbortAction(true);
}
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 11:33 AM - edited ‎10-10-2022 11:33 AM
You can use addQuery or addEncodedQuery
grDemandTask.addQuery('short_description', 'CONTAINS', 'text here');
grDemandTask.addEncodedQuery('short_descriptionLIKEtextHere');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 11:33 AM - edited ‎10-10-2022 11:33 AM
You can use addQuery or addEncodedQuery
grDemandTask.addQuery('short_description', 'CONTAINS', 'text here');
grDemandTask.addEncodedQuery('short_descriptionLIKEtextHere');