Skip to main content
Planview Customer Success Center

Unable to update resource workgroup through API (2012)

Symptoms:
Workgroup transfer is not done, with no error message or warning. SQL Profiler trace shows that the effective date is around year 1700s, which is before any previous transfer date hence the transfer fails.

Sample code:

newres = res_proxy.GetById("...").value

newres.GlobalWorkgroup = New WSResource.Identity
newres.GlobalWorkgroup.Id = "..."
newres.Workgroup = New WSResource.Identity
newres.Workgroup.Id = "..."

result = res_proxy.Update(newres)

Reason:
When ReportsToEffectiveDate field has no value then the minimum system date is used, which is not a valid transfer date therefore the transfer is not done. This is a defect in v2012 API.


Alternative:
Alternative solution is to assign the current date to ReportsToEffectiveDate, before updating the resource:

newres.Workgroup.Id = "..."

newres.ReportsToEffectiveDate = Now.Date

result = res_proxy.Update(newres)

 

Additional notes:
Use the same alternative solution when modifying the ReportsTo field via API:

newres.ReportsTo.Id = "..."

newres.ReportsToEffectiveDate = Now.Date

result = res_proxy.Update(newres)