- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:10 PM
Hi gang,
I've got a workflow for an application request catalog item, and in that I'm using a "Catalog Task" activity to create a task. I need to have a 2nd activity later in the workflow reference that created task to either close it, or assign it. To further explain, I'm using orchestration to add a user to an AD group, but I want to have a task record created so that we can track the number of requested items. So I want the task to be created (but not assigned), and then if the "Add user to group" orchestration activity is successful, I want to close that task. But if the orchestration activity is unsuccessful, then I want to be able to set the assignment group.
To do so, when the task is created in the activity, how can I grab the sys_id of the created task record and write it to the scratchpad?
or is there another way to reference a task created with a workflow, later in the workflow?
thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 04:16 PM
think I figured it out...this worked for grabbing the sys_id of the task created by the Catalog Task activity.
workflow.scratchpad.taskid = task.setNewGuid();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:14 PM
I am not quite sure of the sys_id, but you can grab the task number by adding the following line in the Advanced script section in the catalog task activity
workflow.scratchpad.task_number=task.number;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:16 PM
thanks, that should work. And then in my 2nd activity, I can just do a GlideRecord to find that task and update it. Or is there an easier way to update that task in an activity later in the workflow that you know of?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:18 PM
I would say use a Run script activity and do a GlideRecord query based on the task number and update accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 02:19 PM
perfect, will try that. thanks Abhinay!