Workflow Advanced Script

Maki
Tera Expert

Hello all,

last but not least i need help with a catalog task. I want to use the same worfklow (sc_request_item) with more items.

In this workflow is a catalog task, assigned to our ServiceDesk. 

My problem is to show the current variables in the task. 

For Example the workflow is in "item1" / "item2" / "item3". 
Item1 variables: test1 / test2
Item2 variables: snow1 / snow2
item 3 variables: sun1 / sun2

So all variables got different names. Is there a way via script, to check the current variables of the requested item?

This is what i got now:

task.short_description = current.cat_item.name; // working
task.variables = current.variables; //Does not work! nothing happens here!

 

12 REPLIES 12

Ok, something like this i was looking for.
But where is the InfoMessage displayed / printed in the task on your example?

Hi This is just a general example on how to generically access variables. You can modify as needed. The addInfoMessage() is shown in the UI but you can test it in Scripts Background to adjust to your needs. You can now do the fun part. Let me know if that answered your question and mark my answer as correct and helpful BR Dirk

Maki
Tera Expert

I found a way without scripting. After the workflow has been deposited at each item, i can open the catalog task in the workflow and every variable of each item is available in the variable editor.  

I choosed them all. But in the catalog task for the service desk is justed display the variables of the current requested item.

With this way, i also have to update the catalog task in the WF every time when i new item is created, what I wanted to prevent, but its ok for the first time until i found a better way via script.