Modify time in My Tasks via code

C

Chupacabra

Is there a way through the PSI (or otherwise) to "poke" time into the My
Tasks page in PWA 2007? We are only using the My Tasks page, not
timesheets. I would like to be able to add some time collected in an
external application to a line item under "My Tasks" for every employee on a
daily basis.

I had this working in Project 2003, but don't see any way so far to put time
into "My Tasks" via code. I guess I could poke the time into timesheets and
then synch the timesheets back to My Tasks, but that seems like a lot of
extra work.

Thanks!
 
C

Chris Boyd

Hey,

It is possible. Take a look at the statusing PSI:

http://msdn2.microsoft.com/en-us/library/websvcstatusing.statusing_methods.aspx

You are going to have to use the UpdateStatus(…) method. There are a couple
of things to note about the UpdateStatus method:

- It runs as the context of the user/resource executing the method. So if
you need to do updates on the behalf of someone, you are going to have to use
impersonation: http://msdn2.microsoft.com/en-us/library/aa974347.aspx

- The UpdateStatus method uses what we call our “Change XML†opposed to
datasets like the other update methods in the PSI. I suggest you take a look
at: http://msdn2.microsoft.com/en-us/library/bb428819.aspx


--
Chris Boyd
MS Project
Program Manager

Blog: http://blogs.msdn.com/project_programmability/
 
C

Chupacabra

I've been playing with the Statusing method, as well as the Project Server
ChangeXML utility. I can successfully submit changes such as Finish, etc
and the changes do show up on My Tasks. However, I still don't see any
method that could be used to put time into a particular day.

For example, I'd like to poke 4 hours into January 29 for a task called
"Jury Duty" on the My Tasks page. Do you think that is doable using the
Statusing method?

Thanks!
 
C

Chupacabra

I don't have any code examples, but you should be able to do it. That is
how
the PWA page submits status updates. Anything you do on the My Task web
part
does it through the UpdateStatus method.

OK, I'll keep looking. I'm having issues now with the ChangeXML sample
code. I can log in to the PWA web server and sometimes submit an XML change
which works, but subsequent submissions cause the IIS process on the Project
Server to spike at 100% CPU for a few minutes then returns an error....
 
C

Chupacabra

I finally got it working through a VB.NET application. However, like you
said I can only update time in My Tasks for myself.

Other than impersonation, there is no other way to update time in My Tasks
for others in my organization? I read through the impersonation
documentation and that looks like a double-pantload to implement. Just
reading through that made me queasy :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top