Try using task.setNewGuid() instead of task.sys_id in your variable assignment. I'm using this to set a scratchpad variable to the current task's sys_id in one of my workflows.Mine looks like this in the advanced script: workflow.scratchpad.taskid = ...