- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 10:51 AM
Hi,
On the workflow i have a catalog task i need to get the sysID and the assignment group, can anyone please help me how to get this
Above is my workflow, i tried with below scrip in the catalog task activity but it is giving me the null value
// For example:
// task.short_description = current.short_description;
workflow.scratchpad.acbcd = task.sys_id + "Testing";
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:28 AM
Hi,
In the initial task you can use the following to save the sys_id
workflow.scratchpad.taskid = task.setNewGuid();
You can then use the following to retrieve any information about that task in the future.
var taskGR = new GlideRecord('sc_task');
if(taskGR.get(workflow.scratchpad.taskid)){
var group = taskGR.getValue('assignment_group');
}
Or use flow designer and make life 10x easier!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:28 AM
Hi,
In the initial task you can use the following to save the sys_id
workflow.scratchpad.taskid = task.setNewGuid();
You can then use the following to retrieve any information about that task in the future.
var taskGR = new GlideRecord('sc_task');
if(taskGR.get(workflow.scratchpad.taskid)){
var group = taskGR.getValue('assignment_group');
}
Or use flow designer and make life 10x easier!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:53 AM
Thank You
I never thought we can create a sys id from the catalog task activity. I agree to use flow designer but unfortunately its a old legacy workflow so updating the workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2021 11:38 AM
If above script does not work, try with below script
Eg:
Use below script in catalog task activity
var id = gs.generateGUID();
task.setNewGuidValue(id);
workflow.scratchpad.myCustID = id;
Then use log in run script activity.
gs.log('Value is '+workflow.scratchpad.myCustID);