It is not possible to get only non-archived projects via API using node-sdk-v1

Hello all!

Since a few hours (maybe days) it´s not possible to get only non-archived projects via API using the node-sdk-v1. I´am able to get non-archived projects using node-sdk-v3 but not using v1.

You can reproduce the issue by creating a new node project and using the code below:

const asana = require('asana');

const client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');

client.projects.getProjectsForWorkspace(WORKSPACE_ID, {
    team: TEAM_ID,
    archived: false,
    limit: 10,
}).then((result) => {
    console.log(result);
});

We have an APP using the version v1 that is unable to update at this time… I think that v1 should works as expected too and this is an API bug.

Can you help us?

Thank you very much

2 Likes

Hi there,

Same problem since this morning with node Asana v3.
Even on the API reference, defining the field archived to false doesn’t seem to do anything.

Could this be a bug ?

Hello, i have the same problem, since this morning, the parameter “&archived=false” in my get request doesn’t work. What i did is, listed all projecs from a team workspace and in the optional fields i included “opt_fields=created_at,name,archived ” , then what i did is, comparing if this is equals to true or false to only get the non-archived ones.
Hope this helps, and i hope the parameter thing is just a bug.

1 Like

Hi @Alberto20,

This doesn’t look like a client library issue. The API behaves the same when you try this with cURL as well:

curl --location 'https://app.asana.com/api/1.0/workspaces/<WORKSPACE_GID>/projects?archived=false&team=<YOUR_TEAM>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <YOUR_PERSONAL_ACCESS_TOKEN>'

It looks like you are making an API call to our Get all projects in a workspace endpoint. If you look at these docs under the “QUERY PARAMS” section team is not a valid query param for this endpoint.
archived however is a valid query param for this endpoint. If you leave out team and provide archived it should work as expected.

node-asana (v1):

const asana = require('asana');

const client = asana.Client.create().useAccessToken("<YOUR_PERSONAL_ACCESS_TOKEN>");

client.projects.getProjectsForWorkspace("<YOUR_WORKSPACE_GID>", {archived: "false"})
    .then((result) => {
        console.log(result);
    });

1 Like

Hi John_Vu,

The code you have suggested seems to work, ignoring team parameter makes that archived works. That weird because the code I provided previously works well since years until some hours ago…

In view of the above, I supposed that we need to call getProjectsForTeam including param archived: false for getting all non-archived projects from a team… But this also does not working… archived parameter is ignored too.

const asana = require('asana');

const client = asana.Client.create().useAccessToken('XXXXXXXXXX');

client.projects.getProjectsForTeam(XXXXXXXXXX, { archived: false })
    .then((result) => {
        console.log(result);
    });

Can you help to us?

Thank you so much

1 Like

Hi @Alberto20,

That weird because the code I provided previously works well since years until some hours ago…

I checked with our API team and we have identified this to be a bug.

Summary of the issue:

Workaround Soltuion (at least until we have a fix out):

Our API team is currently working on a fix for this so if you are blocked please use the workaround solution.

Many thanks John_Vu , we hope the bug will be resolved ASAP. We look forward to hearing from you.

Hi there! It seems that is working well since this morning, our APP shows the correct projects again! :partying_face: :tada: :clap:

1 Like

Hi @Alberto20,

It looks like you beat me to it. We deployed the fix yesterday. I wanted to wait a bit before replying in case we had to roll back, but we are good here. Thank you for reporting and helping us test this issue :slight_smile:

1 Like

Thank you so much John_Vu :slight_smile:

1 Like

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