
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2019 09:14 PM
We have custom workflow framework to simplify our workflows and as a result all of our catalog task default the opened_by to 'system'
I've written an after insert/update business rule, but it is not updating the opened_by:
var sctask = new GlideRecord('sc_task');
sctask.get(current.sc_task);
sctask.opened_by = current.request_item.opened_by;
sctask.update();
I've reversed the logic and got it working the other way around:
var sctask = new GlideRecord('sc_req_item');
sctask.get(current.request_item);
sctask.opened_by = current.opened_by; //populates the RITM opened_by to 'system'
sctask.update();
Any ideas why my first script does not update the opened_by?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 05:39 PM
Got it working correctly on the sc_task table:
current.opened_by = current.request_item.opened_by
I had my business running on after insert/update instead of before.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2019 11:13 PM
Hi Anna,
The line "sctask.get(current.sc_task);" returns a "NULL" value hence your BR is not being processed.
Could you please re-check once again ad let me know if there are any queries?
Please mark the answer as correct if it suffice your query.
Thanks
Soumita.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 04:13 PM
Hi Soumita,
Thanks for that - I've removed that line, and am still not getting the opened_by to update on tasks. Would replacing that line with something else work? I don't want to run an 'active', true query, as I also want it to pick up tasks that are closed.
Cheers,
Anna

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2019 05:39 PM
Got it working correctly on the sc_task table:
current.opened_by = current.request_item.opened_by
I had my business running on after insert/update instead of before.