Displaying catalog variables on catalog task created by run script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2015 08:15 AM
Hi, I have a requirement to create multple catalog task dimanically in workflow. I achived that by a run script using glide record. however Catalog variables are not showingup on the tasks created. Did any one try showing catalog variables on tasks created by a script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 09:04 AM
I agree with Kalai. He nailed it. That's what we did. Instead of a iFrame, we used a UI Action to show the RITM and it's variables (using a normal window object)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 09:14 AM
Ya I Guess the normal window would be good ..
The extra buttons and headers in the Iframe would be confusing If there is someway to eliminate the headers, it would be just awesome ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2015 10:49 PM
Kalai,
Why not use UI Page or a macro.. It wont show any additional headers and buttons.. and can be easily controlled.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2015 01:07 AM
It's just the same.. The solution was just a suggestion and can be tailored to suit the requirement.
But If you are using UI page/Macro, the headers will still be visible. Won't they ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2017 07:14 AM
I have a workflow where I generate the tasks via script so it is dynamic. To get the variable section to display I did the following code (loop through tasks, loop through item variables, insert records for each task to have the variable):
(function setVariablesonTasks() {
// Display variables on tasks
var tsk = new GlideRecord('sc_task');
tsk.addQuery('request_item',current.sys_id);
tsk.query();
while (tsk.next()) {
try {
// get variables and add to task{
var reqvar = new GlideRecord('sc_item_option_mtom');
reqvar.addQuery('request_item',current.sys_id);
reqvar.query();
while (reqvar.next()) {
var variablereference = new GlideRecord('sc_item_option');
if (variablereference.get(reqvar.sc_item_option)) {
var add_task_var = new GlideRecord('sc_item_variables_task');
add_task_var.task = tsk.sys_id;
add_task_var.variable = variablereference.item_option_new;
add_task_var.insert();
}
}
} catch (err) {
}
}
})();