Issue imitating an out of box UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 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!
