Custom Fields Access Denying

When I try to edit a project with PUT method and add a value for custom_fields, it gives me an error saying custom_fields are only available on paid accounts, not available to free users or guests. I am on a paid account, and have used them before, not sure why it’s giving me trouble now. I’m going to try it again tomorrow to see if it’s just being weird for me, but not sure if this is a common issue?

Thanks

Couple of things could happen:

  • you have a paid account but for a team only and that project is not part of the team
  • you use a paid account but authenticate with a different one in your API calls

Does this ring a bell?

The paid account is for a team yes, but it is the only team I’m a part of and this project is definitely in that team.

I authenticate with my own account which is a paid account. All accounts in the team are paid accounts so this shouldn’t be an issue regardless.

I’m not sure if maybe there was a way that I created this project not under the umbrella of the team? Not sure if that’s even possible given that I’m only on one team. And to clarify, when I say “team” I’m referring to the entire Asana organization or workspace, am I mixing up terminology here?

Thanks for your help.

It’s a bit unclear from that description exactly what you’re trying to do; can you post your code so we can see the endpoint(s) you’re calling and the data you’re passing? Thanks!

1 Like
const url = 'https://app.asana.com/api/1.0/projects/' + projectGID;

  const headers =
  {
    "Accept": "application/json",
    "Authorization": "Bearer " + personalAccessToken
  };

  const payload =
  {
    custom_fields: JSON.stringify({1202766431753778: 'Test ID 12345'}),
  }

  const options =
  {
    method: "PUT",
    headers: headers,
    payload: payload,
    muteHttpExceptions: true,
  }

  const resp = UrlFetchApp.fetch(url, options);
  Logger.log(resp)

This is my code in Google Apps Script, using it in connection with a Google Sheet. I also had issues getting the Asana API to accept my custom_fields object, but I found using stringify in the payload object as I did above was the trick to getting it through.

When I run this code, I get the following error message:

{“errors”:[{“error”:“custom_fields_premium_only”,“message”:“Custom Fields are not available for free users or guests.”,“user_message”:“Custom Fields are not available for free users or guests.”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Asana”}]}

Disregard, it just clicked what I’m doing wrong. When I was adding a custom field to a project, in my mind I was giving that custom label to the actual project object itself. Instead what is happening is I’m giving that project access to use that particular custom field to label the tasks within. So the custom field’s specific value applies to tasks individually, I can’t label the project as a whole with a custom label.

Not sure if that makes sense, but problem solved. Thank you for your help!

1 Like

fyi there are also custom fields that could apply to the project itself, through a portfolio.

2 Likes