Issue imitating an out of box UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 5 hours ago
Hello,
I am trying to replicate the logic of the out-of-box UI action on sc_request called "Cancel Request".
The logic in that UI action is pretty simple:
current.request_state = 'closed_cancelled';
current.stage = 'closed_incomplete';
current.update();I've created a UI action on the sc_task table using basically the exact same logic, except I'm querying the request because dot walking didn't seem to work:
var req = new GlideRecord('sc_request');
if (req.get(current.request)) {
req.request_state = 'closed_cancelled';
req.stage = 'closed_incomplete';
req.update();
}
Regardless of which UI action I use, the result is that the state and stage fields of the RITM are set correctly. But the way the stage is displayed in the list view is incorrect. You can see in the below image, that the red X indicates that RITM has been cancelled, vs the top request shows that fulfillment was completed and closed cancelled was skipped.
So something isn't quite behaving in the custom UI action like it does when using the out of box action, and I'm hoping someone might be able to shed some light on this, or at least point me in the right direction to figure out what I'm missing here.
TIA!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
33m ago - last edited 32m ago
Are those two ritms the same catalog item with the exact same work/flow? Cancelled at the same point in the flow? And what do the flows look like?
Consider this oob flow, it's been cancelled with the ui action in stage order fulfillment while the task is still open.
Order fulfillment shows up completed and request cancelled step is skipped because the br will just cancel the flow and the flow stage will never happen so it is misleading.
I don't see any reason why the behaviour would be different from your ui action because they do exactly the same thing. Unless there is something else in the custom ui action of course
