
- 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-28-2019 09:19 PM
your business rule is in which table ..?? sc_task or sc_req_item?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2019 09:26 PM
Hi Satheesh
On the 'sc_req_item' table.
The second one ran successfully on the 'sc_task' table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2019 09:35 PM
ok then .. the issue is
there is no field in sc_req_item table as sc_task
also you cant access current.request_item.opened_by in sc_req_item record.it should be current.opened_by
requested and task has one to many relationship.
each requested item can have multiple tasks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2019 01:14 PM
Thanks I've changed the table for the business rule to run on back to 'sc_task'
var sctask = new GlideRecord('sc_task');
sctask.get(current.request_item);
sctask.opened_by = current.request_item.opened_by;
sctask.update()
But still not having any luck populating the opened_by