I have a WFTask object, and want to reset it's owner (from within a cgi task).It's supposed to return 0 on success and nonzero in the event of an error. On printing the return value, its empty. And the user of the next task ("User") is not changed either. my($success,$next_task)=$thisjob->GetTaskByName("User");print 'return value is' , $next_task->SetOwner("username here"), "\n";Is there something wrong in what i'm doing?
...$next_task->SetOwner($newowner);$next_task->Refresh();my $test = $next_task->GetOwner();if ($test ne $newowner) { # ERROR}
You're not checking the return result of GetTaskByName (the value in $success) - but assuming that worked, the SetOwner call should work provided that the owner specified is legitimate / someone who has access to that branch / workarea.Perhaps try:...$next_task->SetOwner($newowner);$next_task->Refresh();my $test = $next_task->GetOwner();if ($test ne $newowner) { # ERROR}
the GetTaskByName part is working fine.I did what you suggested, but it's still not working. Printing the owner using GetOwner(), after using the SetOwner() method still shows the old user itself..PS. Correction in my first post: it returns non zero on success, and zero if its an error.
Check if the new owner has proper access rights to the WF's Area. Can you initiate a Workflow where this individual is theTask owner in the first place?
yep the owner does have access rights. i tried to specify my own id as the new user, and its not happening..
is there any other sort of command i need to use to reflect the changed values in the server?any reason why the method is returning an EMPTY value?
hi,Would like to continue this post, as I am facing similar kind of issue...Using setOwner() command I want to change owner to administrator so as to unlock the DCR's I am working on.I am trying to update the owner of the task @ run time...,Whereas this task is executed by 'user1' who have an editor role. I tried this command in backend/iw-home/bin/iwsettaskownerandarea 176370 giwcmadm /iwmnt//btgsportal/main/site/inprocess_db/WORKAREA/content_classes/User user1 is not allowed to modify task owner and area.is it like an editor is not allowed to change owner??I am working on TS 6.7.1
Generally, I believe that is true. Editors are not "power users" and as such they cannot do something that is "beyond their skills".If you run that command from the command line via sudo (I'm assuming unix here) - it will probably work.
ghoti,I am new to this command line via sudo,Could you please throw some more light on this... would be happy to know more about this sudo commands... can these commands be achived through cgi scripts i.e. `$cmd`?