Bug: Project Create Color Parameter Not Setting

The Asana documentation includes updating the “color” parameter when creating a new Project.
However, it doesn’t seem to apply correctly in either the Create or Update method.
Even using an extremely simple body like below.
I submitted to Support but it keeps getting bounced back with “try this” or “check this” so giving this forum a shot. My guess is that the enum translation is somehow not working.

URL Request: https://app.asana.com/api/1.0/projects?team=XXXXXXXXXXXXXX
Body:
{
“data”:{
“name”: “Asana Support Test”,
“html_notes”: “

  • One
  • Two
”,
“color”: “dark-pink”
}
}

The resulting project still has a gray icon.
Another thing to note, after creating a project with this parameter the value never changes when doing a GET on the project…even if the icon/project color is changed. This adds support to the issue being somehow related to enum of the color values.

@Jeff_Bantz,

This thread should help, hopefully:

The information is actually included in the documentation and I’m using a valid enumeration.
I tried to pass the color code instead of the enumeration…but that didn’t work. I’m just curious if anyone is actually getting the color to set when they create a new project via API?

{
“errors”: [
{
“message”: “color: Must be one of {dark-blue, dark-brown, dark-green, dark-orange, dark-pink, dark-purple, dark-red, dark-teal, dark-warm-gray, light-blue, light-green, light-orange, light-pink, light-purple, light-red, light-teal, light-warm-gray, light-yellow, none}, not: #E84F9C”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: Errors
}
]
}

I know this is a little old but just wondered if anybody found a resolution to this? I can do other things through API such as change project title but not change the icon or the colour…

@Jeff_Schneider @John_Baldo ?

@Joseph_Pascual sorry to hear you’re having this issue as well. I’m able to both set color upon project creation and update a project’s color via the API.

I tested creating a project with a color using the API explorer in the developer docs. Here’s the curl request that worked for me:

    
curl --request POST \
     --url 'https://app.asana.com/api/1.0/projects' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer XXXXXXXXX' \
     --header 'content-type: application/json' \
     --data '
{
  "data": {
    "color": "dark-green",
    "name": "test project to delete",
    "workspace": "123456789",
    "team": "123456789"
  }
}
'

This succeeded with a 200. I checked the new project in the Asana web app and it was correctly set to dark green. I then fetched the new project with the API (and it correctly returned the project’s color:

     
curl --request GET \
     --url 'https://app.asana.com/api/1.0/projects/1206241618667546?opt_fields=color' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer XXXXXXXX'

Response:

    
{
  "data": {
    "gid": "1206241618667546",
    "color": "dark-green"
  }
}

I tried again with another color and it also worked. I then tested changing the color and that also worked:

    
curl --request PUT \
     --url https://app.asana.com/api/1.0/projects/1206241618667546 \
     --header 'accept: application/json' \
     --header 'authorization: BearerXXXXXXXXXX' \
     --header 'content-type: application/json' \
     --data '
{
  "data": {
    "color": "light-pink"
  }
}
'

If it’s still not working for you, can you please share your full request and response (omitting your token)?

2 Likes

Thank you, Jeff. I have been testing API using postman and I can now change the color which is great! However, it seems as though the icon is not changeable via API, is this possible? I have attached my curl request but have taken off any actual id/tokens.

curl --location --request PUT 'https://app.asana.com/api/1.0/projects/PROJECTGID?icon=html' \
--header 'accept: application/json' \
--header 'authorization: Bearer TOKEN' \
--header 'content-type: application/json' \
--data '
{
  "data": {
    "color": "dark-green",
    "name": "test project to delete",
    "workspace": "WORKSPACEGID",
    "team": "TEAMGID"
  }
}
'
1 Like

Hi @Joseph_Pascual, good to hear project color is now working for you. To confirm, are you asking to write to the icon field that corresponds to the graphic before the project name? For example, this:
Screenshot 2023-12-30 at 3.53.41 PM

Unfortunately, this field is only readable in the API.

1 Like

Okay no worries thanks for all your help @Jeff_Schneider!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.