0
var task = new GlideRecord ('task');
var new_guid = task.setNewGuid();
gs.print(new_guid)
Generates a new GUID and sets it as the unique ID (sys_id) for the current record