Create Status Asana Custom fields

Hi All,

Looking for some help on using the asana client for creating statuses with custom fields.

Now I am able to post sew status with:

client.project_statuses.create_project_status_for_project(
project_gid,params={
“color”: “green”,
“html_text”: “TEST HTML”
}

But I want to post status with custom fields with data like following.

Owner : XYZ
Dates: Jan1 – Jan7
Project Completed:NO
Active Onboarding:true
In Production:NO
Target Production Date:12/31/2022
Customer Target Production Date:5/20/2022
Deployment Type:ABC
This Week’s Hours - Billable: 100
Total Billable Hours:400
& so on

Now i have made a code to get these values which I plan to use, however the challange I am facing is as soon posting all these fields via the client call as above…
Any sample or similar thing done on post will help…
When I try to make an HTML from data I have and try to use it in a variable and pass it in html_text: value…It basically either gives some error or if no error, it posts as is like

Hi,

@Phil_Seeman will tell whether or not I am right but looking at Asana it looks like project statuses and custom fields are completely unrelated. You can update a field without having to update the status. Can you confirm what you want to do is update custom fields?

Right! Projects have statuses and have custom fields, but other than both being properties of a project, they’re not related to each other.

Also note that project status has been deprecated in favor of status updates.

1 Like

Hi @Phil_Seeman
I think custom field is not right term, so the fields I am referring is the fields we choose and click on status update say we choose On Track, we get a field choice “show or hide fields”–> in my sample above those fields in the status updates are from there.

I am able to now post the status updates as HTML strings but how do I assign values to each field.
I hope I am making sense. For instance, How do I assign “XYZ” to Owner, "Jan1 - Jan7 to dates, and so on…
Attaching a picture of what I am referring to.

Now please know I have posted HTMLs but and via HTML I am saying : Owner: XYZ, but thats like literal string, its not assigning to these

@Gupta_Saurabh,

You have raised an excellent question! I did some investigating, and I am totally stumped.

What you are asking about are in fact custom fields. Based on the behavior of the web app, the values one sets for them in a status update must be attached to the status update in some way. But there is nothing in the API that gives access to them, and I did some playing around to try and retrieve them and was unsuccessful.

I suspect these custom field values are simply not accessible via the API, but I’m going to inquire with my Asana dev contacts and will let you know if I get any additional info about them.

My understanding is that when updating the status of a project, Asana gives you the visual opportunity to update the fields as well, even though their update will be unrelated to the status update itself. @Phil_Seeman does that seem correct?

I initially thought the same thing, @Bastien_Siebman, until I tested it and saw that the field values must be getting stored with the status update.

Try this:

Setup:

  • Pick a project for testing; put it in a portfolio.
  • Create an enum custom field with two values, Option A and Option B.
  • Put that custom field in the project and display the field in the portfolio.

Testing:

  • Create a first Status Update, and in it, set the value of the field to Option A.
  • Go to the portfolio and verify that it displays Option A. All good so far.
  • Create a second Status Update, and in it, set the value of the field to Option B.
  • Go to the portfolio and verify that it displays Option B. Still all good.
  • But now, go back and view the first Status Update. The field there shows a value of Option A!! At this point the current value of the field is Option B, but the value of Option A is clearly stored somewhere that must be connected to that first Status Update, right?! Exactly where? I have no idea!

I fired up Postman and tried various things to try and find it, but I was unsuccessful. So my next step is to ask Asana. Will post an update here if I get any additional info on this puzzle.

Oh ok understood, interesting!

Thanks @Phil_Seeman
Well, did you get a chance to see if we can have API calls that can access these fields.

Not yet. While I do have some access to Asana resources, it’s fairly limited so it typically can take a while. You’ll have to be patient, I’m afraid.

Hi @Gupta_Saurabh,

I have news on this, but I’m afraid it’s not good news.

You and I were correct that Asana is storing custom field values within the Status Update object. Unfortunately those values are not accessible via the API for either reading or writing.

The API team has added a feature request to be able to access those. But that just means it’s now on a long backlog of API enhancements to make, so I would not count on it being added any time soon.

1 Like

Thanks @Phil_Seeman