catalog item variables not showing in catalog task

somujit
Tera Contributor

Hello People,

We have added a catalog item using the ItemDesigner and then added some variables using the Maintain Items.

When i open the item from the maintain items, i see the "Item Designer Workflow" in the Workflow field as read-only.

find_real_file.png

The Variables defined as below

find_real_file.png

The RITM generated upon placing the order request is as below, to which a task gets auto generated -

find_real_file.png

find_real_file.png

 

Upon viewing the created Task, the variables value i.e. test for the field abc defined while ordering the catalog item isn't showing in the task form

find_real_file.png  

Any suggestions, how we can bring in the Variable values in the Task form as it appears in the RITM would be much appreciated..!!? TIA..

 

~Somujit

 

16 REPLIES 16

Hello Satheesh,

 

I am using the default "Item Designer Workflow" and i seen no Task Block in the default Workflow.

 

~Somujit

Did you try making that variable Global in your catalog item?


Please mark this response as correct or helpful if it assisted you with your question.

Jaspal Singh
Mega Patron
Mega Patron

Right Click the header of the Catalog task form & then Configure >> Form layout & add Variable Editor.

SeanM1
Tera Guru

I have the same issue, cat item created via item designer, none of the variables appear on the generated catalog task. All the previous solutions provided in this scenario only apply to a normal workflow and not one created via the item designer. I'm just trying to work out is there any value doing item creation via this designer method.

My example, I've created an item with 5 variables, 1 approval & one task. This auto generates 4 workflow and none contain a task that I can add the missing variables too.

1.

find_real_file.png

 

2. 

find_real_file.png

 

3

find_real_file.png

 

find_real_file.png

 

Since you are using Item Designer, we might not be able to use the flexibility of workflows to add variables in the tasks created during the process as there is only one workflow linked to item designer which dynamically creates all the tasks specified in the Task plan of item designer.

 

 

OOB, variables in tasks are shown using the Variable editor. Variable Editor fetches the variables data from sc_item_variables_task table for Tasks and sc_item_option_mtom for Request Items. Since we are not linking any variables to the task created by the Item designer, there is no data present in sc_item_variables_task table for the task created by Item designer.

 

 

 

Workarround:

 

create an Insert business rule at catalog Task level and check if the Request Item.Catalog Item.Workflow == Item Designer Workflow. If so, then run the following script to link the variables to the catalog task.

 

 

 

var item_var = new GlideRecord('sc_item_option_mtom');

 

 

item_var.addQuery('request_item',current.request_item);

 

 

item_var.query();

 

 

while(item_var.next())

 

 

{

 

 

gs.log(item_var.sc_item_option.item_option_new.question_text);

 

 

var task_var = new GlideRecord('sc_item_variables_task');

 

 

task_var.initialize();

 

 

task_var.task=current.sys_id;

 

 

task_var.variable=item_var.sc_item_option.item_option_new;

 

 

gs.log(task_var.insert());

 

 

}

 

 

 

 

 

 

 

 

 

 

 

 

Hope this will help resolve your problem and achieve what you are looking for.