Workfront API: Human readable status for Issues and Projects

521 Views Asked by At

https://support.workfront.com/hc/en-us/articles/115003574147-API-Basics https://support.workfront.com/hc/en-us/categories/202718477

Querying objects (i.e.: GET /attask/api/v9.0/project/4c78821c0000d6fa8d5e52f07a1d54d0) returns a response similar to the following:

..
"status": "INP",
...

How do you get human readable statuses form these responses? Do you hard-code all possible values, or, can it be achieved using queries?

i.e.: "INP" > "In Progress"

2

There are 2 best solutions below

0
On BEST ANSWER

I created a dictionary and translating the statuses while reading the short version (INP > In Progress)

0
On

You can pull these values from the Custom Enumeration tables (CSTEM). For example, this will return all the task descriptions:

https://subdomain.my.workfront.com/attask/api/v9.0/CSTEM/search?apiKey={{apiKey}}&fields=*&enumClass=STATUS_TASK&enumClass_Mod=in

You will get something like this:

{ "color": "FF3939", "equatesWith": "CPL", "groupID": "5419c94f00004a056282a15eed58e47f", "label": "Complete", "objCode": "CSTEM", "value": "CPL", "ID": "57ed3a2000477cfb7368beb5d995bf88", "customerID": "540f5a3f0019b...", "description": "Task is fully completed", "enumClass": "STATUS_TASK", "extRefID": null, "isPrimary": true, "valueAsInt": null, "valueAsString": "CPL" },

For issues use "STATUS_OPTASK".