Attask - Update hidden project properties through

2019-09-12 05:45发布

问题:

I have a number of project fields to be updated via API, which are not visible in workfront UI. I fetch these properties by doing a GET of the project ID. Few fields to name that I need to update are - previousStatus, categoryID, resourcePoolID, scheduleID, eac and others. Please note my extRefID is null.
I have tried this -

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

and this

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

and this

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

and JSON edits as below

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

with body as

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

but nothing seems to work. I get response code 200 for 3rd call, but previousStatus is still not updated. For other calls I get:

"Parameter with primary key value(s) \"previousStatus\" not found"

Can any one please suggest the right approach if it's achievable? Thanks in advance!

回答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.