Follow
Tracking Hour Records with API

Many customers use Workfront to have their employees enter their hours worked but many of those customers do not use Workfront as the system of record for that data so they have to go through the process of syncing up that data between two systems. Simply tracking the hour record is not feasible because if the hour entry is removed the entire record is deleted which would require pulling the entire data set and compare it to the old set. Fortunately, all hour transactions are recorded in Workfront Journal Entries.

After retrieving an initial set of all the current hours in the system you can track any and all changes through the Journal Entries.

GET /attask/api/v5.0/JRNLE/search?subObjCode=HOUR&fields=changeType,aux2,newNumberVal,oldNumberVal,subObjCode,subObjID

{
"data": [
{
"ID": "5785406d008d93dd35665f14d90d4929",
"objCode": "JRNLE",
"changeType": "A",
"aux2": "Brad Littler",
"newNumberVal": 1,
"oldNumberVal": null,
"subObjCode": "HOUR",
"subObjID": "5785406d008d93dce3f7f2e0e8eda4ea"
},
{
"ID": "57854124008da2b9f372c01f8b9054bf",
"objCode": "JRNLE",
"changeType": "D",
"aux2": "Brad Littler",
"newNumberVal": null,
"oldNumberVal": 1,
"subObjCode": "HOUR",
"subObjID": "5785406d008d93dce3f7f2e0e8eda4ea"
},
{
"ID": "5785416f008db05ecee934663a968366",
"objCode": "JRNLE",
"changeType": "A",
"aux2": "Brad Littler",
"newNumberVal": 1,
"oldNumberVal": null,
"subObjCode": "HOUR",
"subObjID": "5785416f008db05d9d2925c12b10f521"
},
{
"ID": "57854176008db22fe974b7c67feea6b2",
"objCode": "JRNLE",
"changeType": "E",
"aux2": "Brad Littler",
"newNumberVal": 2,
"oldNumberVal": 1,
"subObjCode": "HOUR",
"subObjID": "5785416f008db05d9d2925c12b10f521"
}
]
}

Here is a description of those fields
changeType: The type of change being made to the object:
A: Add
E: Edit
D: Delete
aux2: This will be the name of the user the hour record is for.
newNumberVal: New value of the hour record (This will be null if the changeType is D).
oldNumberVal: Previous value of the hour record.
subObjCode: Type of record being modified (Should always be HOUR).
subObjID: ID of the Hour record.

You can use this information to find out what hour records have been changed, edited or deleted and then use the subObjID to go and retrieve more information from the hour records if necessary.