Search code examples
attaskworkfront-api

What are the valid color values for tasks in version 4 of the Workfront API?


I'm trying to work out a better way to color the tasks in my iterations in Workfront (formerly AtTask).

By filtering for the Task object in https://developers.workfront.com/api-docs/api-explorer/ all I see is that it's a string:

API Key: color
Field Type: string

I poked around with setting different color values ('yellow', 'green', 'red', etc) and seeing what the task shows, but I couldn't find a full list. I'm trying to figure out if I have enough colors to do a different one for each project, or if I have to pick a smaller subset (user assigned, etc).


Solution

  • I ended up cycling through the color values available in the UI and checking to see what the API listed those color values as. I found the following colors were available, but a couple of them were backwards. So either it's a bug in the API or it's some next-level trolling for April Fool's Day.

    Here's a JSON mapping of the color you'd want to show up to what you'd tell the API to set the color as:

    {
      "api_color_correction": {
        "none": "default",
        "green": "green",
        "purple": "blue",
        "blue": "purple",
        "yellow": "yellow",
        "teal": "grey",
        "grey": "dark-grey"
      }
    }