Here is my JS script located in Data Dictionary folder and executed on custom action ("id" aka node ref and "taskid" are passed in):
var id = args["id"]; var taskId = args["taskId"]; var task = workflow.getTaskById(taskId); var taskType = task.qnameType; var result = "<script>location.href = 'http://myserver/mypage?documentid=" + id + "&taskid=" + taskId + "&type=" + taskType + "';</script>"; result;