Project and Portfolio Management Practitioners Forum
cancel

Cannot update unassigned assignment ?

SOLVED
Go to solution
Highlighted
roxor
Honored Contributor.

Cannot update unassigned assignment ?

Hello friends,

 

I am using web services to set tasks as Completed in the work plans. It works when task was only created but no one charged time there.

 

Now I realized that when someone charge time to the task (and this time is approved by his approver), this user will be added to this task as contributor. So I got something like this:

 

 

 

After user charge time to the task, my web service tool can't set task to Complete status. Here is important piece from stackstrace:

 

org.apache.axis2.AxisFault: Cannot update unassigned assignment for task 396300
because it has actual resources assigned.

 

I am using this method with web services:

 

 private void updateTaskActuals(TaskType taskDet) throws RemoteException {
  //Create input document
  UpdateTaskActualsDocument updActDoc = UpdateTaskActualsDocument.Factory.newInstance();
  
  //create and add an empty UpdateTaskActuals element
  UpdateTaskActuals  addTWP = updActDoc.addNewUpdateTaskActuals();
  
  //create the assignment information for which needs to be updated
  AssignmentType assignment = addTWP.addNewAssignments();
 
  //TaskId is required for updateActuals, due to jibx constraint, this
  //restriction is not reflected in preoject.xsd.
  assignment.setTaskId(taskDet.getTaskId());
  
  Calendar taskScheduleStart = Calendar.getInstance();
  taskScheduleStart.setTime(taskDet.getSchedulingBean().getScheduledStart().getTime());
  
  Calendar taskScheduleFinish = Calendar.getInstance();
  taskScheduleFinish.setTime(taskDet.getSchedulingBean().getScheduledFinish().getTime());
  

//this is important for closing tasks without actuals

  assignment.setActualStart(taskScheduleStart);
  assignment.setActualFinish(taskScheduleFinish);
  assignment.setPercentComplete(100);
 
  //Calling web service
  ProjectServiceStub stub = new ProjectServiceStub(ctx, WSURL);
  stub.updateTaskActuals(updActDoc);
  
 } //end updateTaskActuals

 

I don't understand what is wrong and what PPM want from me with that 'Cannot update unassigned assignment for task 396300 because it has actual resources assigned.'.

 

When I want to set task as Completed manually, It is possible. I supopse that there is need to add something to manage these actuals... Please help.

 

Maybe I don't understand this 'Actuals' stuff properly.

 

Kind regrads,

r.

8 REPLIES
Kerim KILIC
Honored Contributor.

Re: Cannot update unassigned assignment ?

hi,

 

i used these web services also, as i remember  when time management integration enabled it does not allow it to enter actual; and you need to update resource actual also. can you please try first disable time mgt integration from project settings then remove tm license from resource then update resource actual then update task status as complete. 

 

regards

kerim

roxor
Honored Contributor.

Re: Cannot update unassigned assignment ?

Hello Kerim,

 

thanks a lot for your hints, but I am sorry maybe I didn't get your message in the right way. I can't remove time integration from the project becuase I have this message then:

 

Tasks from the project have already been added to time sheets. The integration with Time Management cannot be turned off anymore for this project.

 

Then I tried to remove TM licence from user but with no luck when trying to set task Complete via web services.

 

BUT, I have discovered one possibility. When I assign resource to the task manually, And this resource is already in the task as contributor with some actuals, he is assgined to the taks also with these actuals and is no longer contributor. When I have assgined resources in the task, I can use web services to set it to Complete. It works for me only in this way.

 

But now I am not sure in these points:

  1. if it is possible to assign resource to the task via web services
  2. and what is the difference for our project manager, when completed tasks have actuals from contributors or assigned resources instead of contributors. I can see no difference, but maybe there is something...

Anyway, best option is to set task to Complete status as is - with TM integration on the project, when users are only contributors with their actuals. It is possible to do it via frontend so I don't understand why it does not work using web services...

 

Kind regards,

r.

Kerim KILIC
Honored Contributor.

Re: Cannot update unassigned assignment ?

hmm, as i remember contributors are not real resources, in that case those tasks are recognized as summary tasks. you need to choose one, if you want to add resource to task via webservice then that user does not have tm license, in order to add user as resource you have to fill all fields like you add from frontend like schedule duration, dates etc.  if you dont parse all these parameters to webservice that user recognized as contributor not real resource. i worked with 8 version task webservices, as i remember it works like this. i can send you method if you want. 

roxor
Honored Contributor.

Re: Cannot update unassigned assignment ?

Hello Kerim,

 

please send me the method, maybe I could learn something from it. I'm going to send  you message with my email.

 

I can see big problem in that tm license. All of our resources have this licence.

 

Kind regards,

r.

Kerim KILIC
Honored Contributor.

Re: Cannot update unassigned assignment ?

hi roxor,

yes that tm license is an issue, what i suggest is that you can do in this way, before running webservice you can remove license from attached resources to task; then call method then give tm license again. I think in this way it will work. im sending method that i used for updating task actuals
roxor
Honored Contributor.
Solution

Re: Cannot update unassigned assignment ?

Hello Kerim,

thanks a lot for your method I saw some interesting stuff there.

After all, I decided to close my tasks by direct update of the database. I hope that I am not running to troubles with this solution, but it was the fastest and one and only option when I need to close many tasks where I have lot of contributors.
I am updating these tables: wp_task_actuals, wp_task_info, wp_work_units

Thanks for your suggestions and for your hints about contributor details, tm licenses issue etc.

Kind regrads,
r.
Kerim KILIC
Honored Contributor.

Re: Cannot update unassigned assignment ?

hmm, i think pmtm sync service overwrite what you have done in db. ill double check this contributor thing, but if those tasks are summary tasks, after closing subtasks via timesheets these tasks will be closed automaticallly. if not summary tasks; you can update db tables but may be service overwrite it.
roxor
Honored Contributor.

Re: Cannot update unassigned assignment ?

Hm, these tasks are not summary tasks. I did first changes in database two days ago and tasks are still closed. TM sync service is schedueled to 3 hours so I would say that in this case it is OK.

 

But I still can only hope that I am not running to troubles somewhere else with this direct database update:)