我正在尝试针对MS Project Server 2013中可用的某些特定任务添加时间表条目。我可以使用REST端点在Project Server中创建TASK的方法,但是找不到时间表的直接方法。经过一番审查,我收集了一些细节:
To See the Complete Meta Data: http://>/PWA/_api/ProjectData/$metadata - You can get the field details, Where as I need to know in specific the Entity for TimeSheet. To See the Complete Time Sheet Period Available: http://>/PWA/_api/ProjectServer/TimeSheetPeriods - You can see all the available TimeSheet Periods.
我知道TimeSheet仍然是单独的实体,不属于通常的项目实体。
在这里我的查询特别了解要为时间表添加和更新处理的实体。请在端点方面帮助我,包括保存,发布和签出!
答案 0 :(得分:1)
如果有人仍然像我一样为此而苦苦挣扎....这对我有用。要替换任务中给定日期的实际工时 - 输入您的时间:
Uri:
http://<sitecollection>/<site>/_api/ProjectServer/TimeSheetPeriods('periodid')/TimeSheet/Lines('lineid')/Work('yyyy-MM-dd')
方法:PATCH
标题:
Accept - application/json;odata=verbose
Content-type - application/json;odata=verbose
Odata-version - 3.0
If-Match: *
身体:
{
"__metadata": {
"type": "PS.TimeSheetWork"
},
"ActualWork": "10"
}
我输入的时间是 10 小时。
答案 1 :(得分:0)
您如何添加任务? Http请求?您开发了一些应用程序吗?
我尝试了几种方法,通过Postman将实际值添加到已经使用REST端点创建的时间表中,但没有成功。它总是以以下错误响应:“此页面的安全验证无效。”,我认为我缺少一些标题。
这个端点与我所得到的尽可能接近:
提交时间表
POST-http://> / pwa / _api / ProjectServer / TimeSheetPeriods('periodid')/ TimeSheet / submit(comment)更新时间表
POST-http://> / pwa / _api / ProjectServer / TimeSheetPeriods('periodid')/ TimeSheet / update()
我看到了这些端点here。
希望这会有所帮助!