10

I am using PHPStorm 8.0.2

Adding server:

Tools > Task & Context > Configure server.

Based on https://asana.com/developers/documentation/getting-started/authentication#sts=API%20Keys .

Always getting 403, does anyone tried to connect this from PHPStorm?

Justin
  • 3,418
  • 3
  • 27
  • 37
Codium
  • 3,200
  • 6
  • 34
  • 60

5 Answers5

12

If you need to connect to the project in asana, in the beginning do as described above

1) Personal Access Token and use that as your Username in the Servers configuration in PHPStorm 2) Project ID comes from the URL if your within the Project (the first long number)

3.a) In phpStorm change "Task List URL"

with "{serverUrl}/projects/{project_ID}/tasks?assignee=me"

to {serverUrl}/projects/{project_ID}/tasks

If you want to work with "Personal Tasks"

3.b) In phpStorm change "Task List URL"

{serverUrl}tasks?workspace=[workspace_id]&assignee=me

[workspace_id] get here https://app.asana.com/api/1.0/users/me

Farkhod Daniyarov
  • 748
  • 12
  • 14
  • I get the error message "JsonPath expression 'id' doesn't match" using these settings. – piersb Feb 20 '20 at 12:45
  • @piersb Looks like they changed their json. Try gid and data.gid under Servers > Server Configuration > path. You can type right in there. – Tarek Adam Nov 06 '20 at 15:54
8

Nov 2016 important addition to (mostly) working recipe of @Jonas Krispin:

  • password field should be empty, otherwise you are not going to connect

so, finally:

  • Server URL: leave as is (https://app.asana.com/api/1.0)
  • Username: Personal Access Token which you generate in your Asana account settings
  • Password: empty
  • Project ID: number in your project's URL just before "/list" part (httpx://app.asana.com/0/123456789101112/list

in PhpStorm 2016.2 settings look as follows:

enter image description here

not enough reputation to add a comment

maoizm
  • 682
  • 13
  • 17
  • For my organization I had to supply my account password. Trying without the password resulted in `Request failed with HTTP error: Bad Request` – Will B. Jan 03 '17 at 13:42
6

Edit 15.06.2017: The Url's have changed, so if you get a "Bad Request" with seamingly correct settings, check the Task-list urls from this answer

Here´s what worked for me based on https://youtrack.jetbrains.com/issue/WI-19852 from LazyOne´s comment

1) get a API key Personal Access Token and use that as your Username in the Servers configuration in PHPStorm

2) Project ID comes from the URL if your within the Project (the first long number)

3) Password is your Account Password

Edit 15.07.2016: Asana deprecates the API keys in favor of the personal Access tokens. But with that it works the same way.

Jonas Krispin
  • 136
  • 1
  • 6
2

I'm getting an error Request failed with HTTP error: Bad Request if in the Task List URL in the Server Configuration tab is set to:

{serverUrl}/projects/{project_ID}/tasks?assignee=me

The following setting in that field worked for me (workspaces={workspaces_ID}):

{serverUrl}/projects/{project_ID}/tasks?workspaces={workspaces_ID}

There is no field for workspaces_ID, so it's entered in the field, like:

{serverUrl}/projects/{project_ID}/tasks?workspaces=336484028

PS. Not enough reputation to add a comment

Vladimir Syeik
  • 185
  • 2
  • 7
1

Update 2020 - after last Asana changes task id parametrer must be changed from "id" to "gid" Server Configuration

procek
  • 111
  • 1
  • 5