
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2016 03:11 PM
We have a custom provisioning process that creates a request from an email, and two items (fulfillment and billing) within that request. Each item has 'standard' tasks that are created via the workflow. The provisioning team then has to create a bunch of new tasks within the item to complete the provisioning of services.
I have a variable, req_details, that is visible on the items, and is visible on the auto-created catalog tasks. But when we create a new task within the item, the variable is not visible. The Variable Editor is on the form (obviously, because we can see it on the other tasks...)
I'm at a loss as to why that field doesn't show on the manually created tasks. Any ideas?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2016 04:14 PM
Hi kchorny
Write a before insert business rule on sc_task table and put this script in there.
(function executeRule(current, previous /*null when async*/) {
var vars = new GlideRecord("item_option_new");
vars.addQuery('cat_item', current.request_item.cat_item);
vars.query();
while (vars.next()) {
insertVariable(vars.sys_id);
}
function insertVariable(id) {
var gr = new GlideRecord('sc_item_variables_task');
gr.initialize();
gr.setValue('task', current.getValue('sys_id'));
gr.setValue('variable', id);
gr.insert();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 03:15 PM
vars.addQuery('sc_cat_item', current.request_item.cat_item);
Change line 3 to the above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2016 04:07 PM
So how are you creating these catalog task? By going from the related list on the request item?