0

我有许多要通过 API 更新的项目字段,这些字段在工作区 UI 中不可见。GET我通过执行项目 ID来获取这些属性。我需要更新的几个字段是 - previousStatus、categoryID、resourcePoolID、scheduleID、eac 等。请注意我的 extRefID 为空。
我试过这个 -

 https://abc.attasksandbox.com/attask/api/project/57--b8477f7?DE:project={previousStatus:EST}&apiKey=759--ux&method=put

和这个

https://xyz.attasksandbox.com/attask/api/project/57d6--f7?DE=previousStatus:EST&apiKey=759--xu&method=put

和这个

https://xyz.attasksandbox.com/attask/api/project/57--f7?updates={"previousStatus":"EST"}&apiKey=7--xuk&method=put

和 JSON 编辑如下

https://xyz.attasksandbox.com/attask/api/project/57--f7&apiKey=7--xuk&method=put

以身体为

{
    Project: [ 
        { 
            previousStatus: "EST"
        } 
    ] 
}

但似乎没有任何效果。我得到第三次呼叫的响应代码 200,但 previousStatus 仍未更新。对于其他电话,我得到:

"未找到具有主键值的参数 \"previousStatus\""

如果可以实现,任何人都可以提出正确的方法吗?提前致谢!

4

1 回答 1

1

Most of the those fields can and should be set using the API, but some of them are still calculated and therefore can not be set directly. Previous Status is exactly what it says, it is autoset by changing the status of the project. If the project was CUR and changed to CPL then the previousStatus would be CUR because it was previously in the CUR status. This is used for reports or audits to ensure process compliance.

EAC is also auto calculated from the tasks and project attributes.

It should be noted that categoryID is the legacy term and they have since be relabeled in the UI as Forms. So you would go to Setup and grab the ID from there. You must have at least one form on the project to set the subsequent custom form values. You may have more than 1 by using v5 of the API and setting the categoryIDs collection.

CompanyID, ScheduleID, ResourcePoolID etc are all settable without a problem.

If you can't set it in the UI you probably can't set it in the API either. The one exception to this is the extRefID which is not easily settable in the UI, but is intended to be set in the API.

于 2016-09-13T20:40:53.890 回答