Hi.
It appears you are on a process task page.
The example was written using an event button added to the Case Toolbar widget and wired to the Script Adapter on a Case Details page.
Depending which page type you are on, the context in the payload will be a little different. I suggest adding a debugger break at the beginning of your scrip and having a look at what is being passed fo you. Once you have the case reference, the script should work as advertised.
You can also add the following line to the end of the script to automatically refresh the To Do widget to show your new Quick Tasks:
this.onBroadcastEvent(“icm.RefreshToDoTaskList”,null);
------------------------------
DAVE PERMAN
------------------------------