0

I am trying to develop a web application that can fetch data from Asana and generate custom spreadsheet reports. This wrapper class was very helpful in making things simple.

However, I am having a hard time in writing code that gets me the team/s that a particular task belongs to. Even when I export data as JSON through Asana's web application the 'teams' find no mention. From what I understand, Asana itself does not provide an association between teams and tasks. Please correct me if I am wrong.

But if I am right at my conclusion, is there a workaround I could use? Teams are an important part of my data rendering and I need them to be mapped correctly in my reports that I am trying to generate from Asana. The report I want to generate would be hierarchical in nature.

  • Organisation
    • Team
      • Projects
        • Tasks
          • Subtask

Can I do something to achieve this hierarchy? The only place I get stuck is getting the projects under a particular team.

Mayank Choudhary
  • 376
  • 2
  • 7
  • 18

1 Answers1

0

Glad to hear that you found that wrapper useful. We will be releasing a PHP Library ourselves soon that you may be interested in. Stay tuned!

Below is some pseudo-code to derive the hierarchy you are looking for, I think. Let me know if it helps.

GET /workspaces

    {
      "data": [
        {
          "id": 1234,
          "name": "Startup Inc"
        }
      ]
    }

GET /workspaces/1234

    {
      "data": {
        "id": 1234,
        "name": "Startup Inc",
        "is_organization": true,
        ...
      }
    }

Because is_corganization is true, we can then continue...

GET /organizations/organization-id/teams

    {
      "data": [
        {
          "id": 9876,
          "name": "Ninja Team"
        }
      ]
    }

GET /teams/9876/projects

    {
      "data": [
        {
          "id": 5678,
          "name": "Stealth Project"
        }
      ]
    }

GET /projects/5678/tasks

    {
      "data": [
        {
          "id": 8675309,
          "name": "Top secret video"
        }
      ]
    }

GET /tasks/8675309

    {
      "data": {
        "id": 8675309,
        "created_at": "2015-03-25T17:28:59.255Z",
        "modified_at": "2015-05-15T03:13:28.754Z",
        "name": "Top secret video",
        "notes": "https://www.youtube.com/watch?v=6WTdTwcmxyo",
        "completed": false,
        ... # All the task data
        ]
      }
    }
Andrew Noonan
  • 848
  • 6
  • 13