I'm developing a Project Server 2010 Timesheet importer. It works just fine with Actual Hours in the Project Web App (they import).
The problem
The problem is the client needs the planned work updated accordingly to the entered actual work.
After calling timesheetClient.QueueUpdateTimesheet() it DOES NOT update planned work based on the Project Server automatic work planning feature :<
If you look at the screenshot provided there are 22 and 10 hours, but not "Zaplanowana" -> Planned Value!
If you just click the text and enter them manually, the planned work appears.

I can change timesheetDs.TS_ACT_PLAN_VALUE manually, but i don't want to write a complicated work planning algorithm by hand (it is really complicated in the Project world, trust me).
actual.TS_ACT_VALUE = 1000 * 60 * hours;
actual.TS_ACT_PLAN_VALUE = ???;
Two possible solutions
1. hacking the PWA Timesheet JSGrid
(Javascript controll) by trying to emulate user editing the rows manually which is "quite" hard
window.timesheetComponent.get_TimesheetSatellite().GetJsGridControlInstance()
2. Trying to use the same webservice which is used by PWA Timesheet Control
The problem is that it is undocumented.
We could (in theory) call TimeSheetSendGridUpdatesForSave Action on /pwa/_vti_bin/PSI/ProjectServer.svc and the next call to retrieve the hours (ReadTimesheet via Official TimesheetClient) or TimeSheetGetTimesheetForGridJsonFromViewUid as a pwa js client is calling, would result in updated planned hours
That apprach has a provlem i didnt solved yet - how to authenticate - more on this on a second question How to Authenticate into Project Server SOAP Api outside projectserverservices.dll
keywords: planned work, planned hours, pwa plan, project server 2010, planowane godziny
DISCLAIMER FIRST
Use at your own risk. This code is NOT PORTABLE, which means Microsoft is not obliged to inform you that something changed within their internal webservices.
Working Solution
Trying to use the same webservice which is used by PWA Timesheet Control The problem is that it is undocumented. We can call TimeSheetSendGridUpdatesForSave Action on
/pwa/_vti_bin/PSI/ProjectServer.svc.How?
First, you have to authenticate against PSI outside of standard dll. Problem described and solved by mylself HERE
Then you need to call the webservice with data. For example we will use this request, which changes actual hours on my task to 12h. Following snippet is copied from Chrome DevTools -> 'Network' Tab when you change hours and click save on a actual PWA Timesheet client (in browser at
http://servername/pwa/Timesheet.aspx?tsUID=06b92bf0-806e-44d5-8c94-616c50471920)In SOAP UI in the Auth Tab you have to supply you credentials as a user which owns the timesheet. You cannot just make a request from admin account because PSI will return
That just works as on the gif below
Update 27.08.2019
Code for a call:
Using RestSharp: