- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 09:58 AM
Hi Team,
We have a workflow on RITM table.
after a catalog task creation using catalog task activity, I am setting scratchpad object with this task sysID.
in next step I am using wait for condition , using scratchpad value, quering sc_task table and I am checking for state change to cancelled backend value is -10.
workflow has reached this wait for condition but even after updating the state of task to cancelled still workflow is stuck at wait for condition activity only.
If I check for any other state like closed (backend value is 3). its working fine.
Any suggestions team?
bit urgent.
Best Regards,
Pooja
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 11:37 AM
The workflow is running on the RITM record, so the Wait for scripts only re-runs every time there is an update to the RITM record. Closing a Catalog task usually causes a RITM record update. If it does not in this case, you can try to add a Business Rule to the sc_task table that forces a RITM update when a Catalog Task state changes to Cancelled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 10:09 AM
Please share screenshots from your workflow. Wait for condition. and scripts where you are setting scratchpad.
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 10:18 AM
Hi @Medi C ,
this is the script I m using in wait for condition I did try with backend values instead getDisplayValue, but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 10:30 AM
Hello @Pooja58,
Is your "status" variable declared? Did you log "workflow.scratchpad.sys_id" to see if it is holding the required value?
Please try:
var taskGr = new GlideRecord('sc_task');
taskGr.get(workflow.scratchpad.sys_id);
var status = taskGr.getValue("state");
gs.info("pooja state " + taskGr.state);
if (status == "YOUR_VALUE") { //Replaced with Cancelled value
gs.info("pooja state inside if" + taskGr.state);
answer = true;
}
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 10:27 AM
What logs are you seeing with this script?
var taskGr = new GlideRecord('sc_task');
if (taskGr.get(workflow.scratchpad.sys_id)) {
status = taskGr.getValue("state");
gs.info("pooja status " + status);
if (status == -10) {
gs.info("pooja state inside if " + status);
answer = true;
} else {
gs.info("pooja state else " + status);
}
}