- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 08:47 AM
I have an SLA whose Pause/Resume functions are based on a checkbox on a catalog task. The checkbox is controlled in the background by a catalog workflow "run script" activity.
It starts off as false and then after a timer based on a user entered date, it gets flipped on. However when the variable gets set to true via the script task, the SLA doesn't resume. If the checkbox is toggled manually it triggers the SLA to check if it should resume. Is there a way in the script task to force the SLA to check if the checkbox is true or not?
Edit: I've also tried in the script task force updating, but that doesn't seem to work either
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item',current.sys_id);
taskGR.addQuery('short_description', 'STARTSWITH', 'OFFBOARDING Update AD/change AD password');
taskGR.query();
if(taskGR.next()){
current.variables.ad_sla = 'true';
taskGR.setForceUpdate(true);
taskGR.update();
taskGR.update();
}
Solved! Go to Solution.
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 10:29 AM
had to edit the task workflow and specifically set the stage to in_progress and update()
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', current.sys_id);
taskGR.addQuery('short_description', 'STARTSWITH', 'OFFBOARDING Update AD/change AD password');
taskGR.query();
if (taskGR.next()) {
var slaGR = new GlideRecord('task_sla');
slaGR.addQuery('task', taskGR.sys_id);
slaGR.query();
if (slaGR.next()) {
current.variables.ad_sla = 'true';
slaGR.stage = 'in_progress';
slaGR.update();
slaGR.update(); //updates without a forceupdate. saw on a community post that this was used instead when someone had issues with forceupdate
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 08:53 AM
Hi there!
Could you please add images again as it is broken.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 09:10 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 08:54 AM
Hello,
Please provide more information, such as what is a "script task".
Do you mean a Run Script activity in a workflow?
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 09:11 AM