Add Assigned By to Field Headers in Search and to Project Metadata Available Columns

I’m trying to make a simple Task report for our team. Assigned By, Assigned To, Due Date, Projects. No matter how I configure the Advanced Search parameters, the Assigned By data does not show up as a column on the results list. I suspect it is pulling the data, but just not showing it. Why would you have it as a field choice and not actually show the result in a column. Maybe there’s a way to add it once you get to the results? If you know, let me know.

Welcome, @Micquelle_Corry,

Great point!

@sasha_f and @Phil_Seeman, assigned_by appears to exist in the search interface parameters and nowhere else in the API; how come?

Sorry,

Larry

1 Like

Hi @Micquelle_Corry, you can request for the assigned_by property along with other properties you need using the opt_fields feature of our API

Here’s an example cURL request using the opt_fields feature:

curl --location --request GET 'https://app.asana.com/api/1.0/workspaces/<YOUR_WORKSPACE_GID>/tasks/search?assigned_by.any=<YOUR_ASSIGNED_BY_GID>&opt_fields=gid,name,resource_type,resource_subtype,assigned_by' \

--header 'Authorization: Bearer <YOUR_ASANA_PERSONAL_ACCESS_TOKEN>'

See the task schema for other properties on a task you can request for the response using the opt_fields feature.

@John_Vu,

You’re aware that assigned_by is not listed in the schema in the docs, right? Can it be added, or is there some reason it’s not there?

Also, one other thing: I tried using it in my app in my opt_expand list (I know that’s deprecated but my app needs it to easily expose the properties available for reporting), but that makes my app not work, just as if I were to put in the name of a known-not-existing property. But I tested in Asana API Explorer with opt_expand there and that works as expected. Is there something different about Asana API Explorer vs my app? The explorer also permits known-non-existing properties too.

Thanks,

Larry

Am I supposed to know–as an ordinary user–how to do any of that? Are there additional resources to which you can direct me that will walk me through it? I also can’t add Section to the Task List, even though it shows as a field when I enter a new task. Why? Or, how?

Thanks for your response.

-Lost in Asana Wilderness

Hi @lpb, to answer your questions:

Q: You’re aware that assigned_by is not listed in the schema in the docs, right? Can it be added, or is there some reason it’s not there?
A: Yes. We are aware of this and our API team is looking into why we might have not documented this.

Q: Also, one other thing: I tried using it in my app in my opt_expand list …
A: Yes. We deprecated opt_expand and discourage our developers from using it as it is an expensive request. We recommend our developers use our opt_fields instead. What does your request look like? Are you making a request using one of our client libraries? I tried the following request and was able to get opt_expand to work with assigned_by.

curl --location --request GET 'https://app.asana.com/api/1.0/workspaces/<YOUR_WORKSPACE_GID>/tasks/search?assigned_by.any=<YOUR_ASSIGNED_BY_GID>&opt_expand=assigned_by' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <YOUR_ASANA_PERSONAL_ACCESS_TOKEN>'

Hi @Micquelle_Corry,

We have a section in our developer docs that explain opt_fields under “Input/output options”. We also direct our developers to this documentation under our example responses “See input/output options to include more fields in your response”. We understand that this could be more clear and are working on a solution to help clarify this. For additional resources, I would recommend doing a search in our developer forums for answers.

To answer your question about “can’t add Section to the Task List, even though it shows as a field when I enter a new task. Why? Or, how?” this is because we store information about sections in the task’s memberships property. See our memberships property definition in our task schema for more details. We also clarify this in our Sections documentation → " The ‘memberships’ property when getting a task will return the information for the section or the column under ‘section’ in the response."

Here’s an example request to get this information from our Get multiple tasks (GET /tasks) endpoint:

curl --location --request GET 'https://app.asana.com/api/1.0/tasks?project=<YOUR_PROJECT_GID>&opt_fields=memberships.project,memberships.section' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <YOUR_ASANA_PERSONAL_ACCESS_TOKEN>'

Let me know if you need help with making a request. Happy to help you out :slight_smile:

@Micquelle_Corry,

The short answer is: this isn’t possible now in Asana natively. Perhaps a third-party reporting tool could help (I was hoping I could provide an option with my Asana2Go but ran into an issue, and sorry for turning this discussion into a more technical one regarding that).

I’ve re-titled this thread and moved it to #forum-en:product-feedback so that you and others can vote on it now (I did).

Thanks,

Larry

Thanks very much @John_Vu, for acknowledging about the missing documentation, and also for testing access; it must be something in my app so I’ll double-check there. I’m not using a library but something must be amiss. The reason for opt_expand is that this is for my app, Asana2Go, which is, effectively, a report writer trying to make available all the properties of tasks and subtasks for custom reports.

Thanks again,

Larry

1 Like