- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello All,
I saw one scenario where if i cancel a request which has completed tasks and work in progress catalog tasks for all the tasks it makes as closed incomplete.
where i want it should not close incomplete the closed completed tasks it should only update the incomplete tasks(active true) to closed incomplete.
where is this oob behaviour present which makes this changes?
@Ankur Bawiskar any suggestion on this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
see if this OOTB BR does this "request closure"
Also you can try to enable debug business rule and see which BRs are triggering
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
did you try to set hard-coded value in comment and work_notes?
how about other fields are getting set like stage or state?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Ankur Bawiskar
Yes i tried hard coating the value of comment and worknote tried thats also not working but yes state and stage is getting set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
from UI you are able to add work notes and comment?
try this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Debasis Pati .
Identify the Source of the Behavior
1. Check Business Rules on sc_req_item (Request Item Table)
- Go to System Definition > Business Rules.
- Filter by Table = sc_req_item.
- Look for rules with names like:
- Cancel Request
- Update Task States
- Close Catalog Tasks
- Open each rule and check the Script section for logic that updates sc_task records.
2. Check Business Rules on sc_task (Catalog Task Table)
- Same steps as above, but filter by Table = sc_task.
- Look for rules that trigger on update or state change.
- See if any rule is setting state = Closed Incomplete without checking if the task is already Closed Complete.
3. Check Workflows or Flow Designer Flows
- If your catalog item uses Workflow:
- Go to Workflow Editor.
- Open the workflow associated with the catalog item.
- Look for a "Cancel Request" or "Close Tasks" activity.
- If using Flow Designer:
- Go to Flow Designer > Catalog Item Flows.
- Open the flow tied to the item.
- Look for steps that update task states.
4. Check Script Includes or UI Actions
- Go to System Definition > Script Includes.
- Search for keywords like cancel, closeTasks, updateTaskStates.
- Also check UI Actions on sc_req_item that might trigger cancellation logic.
FIX ----
Once you find the script or flow that updates task states, modify the logic like this:
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', current.sys_id);
taskGR.query();
while (taskGR.next()) {
if (taskGR.active == true && taskGR.state != 3) { // 3 = Closed Complete
taskGR.state = 4; // 4 = Closed Incomplete
taskGR.update();
}
}NOTE -
This ensures only active and incomplete tasks are updated.
Please mark as complete and close the thread if this is helpful.
Thanks,
Rithika.ch
