Workflow Advanced Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 09:26 AM
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!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 09:30 AM
task.variables will not work since variables is not a column on sc_task table.
You will have to use any one of available fields like comments to get list of variables like below
task.comments = current.variables;
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 09:38 AM
Hello,
i also tried task.description = current.variables; //also not working
Do i need a GlideRecord?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 10:09 AM
do you mind to share your script?
do you want to just read variable values?
I hope your workflow is on sc_req_item table.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 10:18 AM
This above is my script 🙂
task.short_description = current.cat_item.name; // working
task.description = current.variables;
Yes the workflow is on sc_req_item
Yes i just want to read the value.
For Example, there are 3 variables (PC / Name / Location) in the item.
So when somebody request this item, our ServiceDesk should get a catalog task with:
PC: 1234
Name: Peter
Location: Amsterdam
Because i want to use this workflow as default, i cannot name the variables in the workflow, because there are different for each item.