rbright / asana Goto Github PK
View Code? Open in Web Editor NEWRuby wrapper for the Asana REST API
License: MIT License
Ruby wrapper for the Asana REST API
License: MIT License
Also this: harley/asana-ruby#3
My original decision to use ActiveResource was short-sighted and largely an experiment with ActiveResource itself. It doesn't provide the flexibility I'd like for the wrapper, so I'd like to implement existing functionality using Faraday and then utilize it to implement new functionality in Asana's API.
Despite what the api claims.
(See #8)
Can you take a look at this pull: harley/asana-ruby#2?
Thanks.
I'm probably missing something (I've been programming ruby for less than 48 hours) but is there a way to get the task detail such as name, due date, etc.?
I'm trying to import a bunch of tasks out of wrike into Asana. My last step has been to add "comments"/"stories" to tasks.
I've tried using created_by and assignee in the story, and neither works. Their API makes me thing it should be: created_by . I've tried passing in my user's asana user id, and passing in a user object...
Can you provide any guidance/tips?
require 'asana'
# replace these
my_client_api_key = "my_api"
my_workspace_id = "my_workspace_id"
my_tag_number = 1234;
my_asana_user_id = 4321;
Asana.configure do |client|
client.api_key = my_client_api_key
end
workspace = Asana::Workspace.find(my_workspace_id)
new_task = workspace.create_task(:name => 'testing stories',
:notes => 'testing stories testing stories')
new_task.add_tag(my_tag_number)
user = Asana::User.find(my_asana_user_id)
story_settings = {
:text => "testing1234 3",
:type => "comment",
:created_by => user
}
new_task.create_story(story_settings)
Hi,
I really like Asana - want to check out its API. Your gem is one of the few Asana Github projects. But I'm new here and need a bit of help re using your gem, specifically, where does
Asana.configure do |client|
client.api_key = 'your_asana_api_key'
end
go? config?
A sample app that grabs say the names of of the api user's workspaces would be a great help!
Suppose a task (T) of 'id' with one project, created by Asana::Task.find(id)
Observed:
What am I doing wrong?
The API is returning a user as being a member of a workspace even after removing a user through the UI. There doesn't seem to be a real way to tell if the user is actually still in the workspace or not.
WORKING WITH TAGS ON A TASK
GET /tasks/task-id/tags
POST /tasks/task-id/addTag
POST /tasks/task-id/removeTag
Each task can be associated with zero or more tags in the system. The API allows you to query and change those associations.
You can query the list of tags associated with a task by using the tags endpoint on a task, which will return a compact representation of each of the tags on the task specified.
You can add or remove a tag using the addTag or removeTag endpoints, respectively, providing the parameters below.
Requests to add/remove tags, if successful, will return success and an empty data block.
tag 1331
The ID of the tag to add or remove from the task.
For some reason, when I call Task.tags, this gets all tags rather than just the tags associated with that particular task.
I also can't seem to fetch all tasks with a particular tag. As per the documentation, in my controller I have:
tag = Asana::Tag.find(6498432136675)
@waiting_tasks = tag.tasks
However, this returns:
Failed. Response code = 400. Response message = Bad Request.
I have confirmed that the id is correct. If i use:
puts tag.inspect
I get the following:
#<Asana::Tag:0x007f94432af498 @attributes={"id"=>6498432136675, "created_at"=>"2013-07-14T10:05:13.070Z", "name"=>"Waiting for", "notes"=>"", "workspace"=>#<Asana::Workspace:0x007f94432aea98 @attributes={"id"=>6399696678844, "name"=>"Ministry of Crazy Ideas"}, @prefix_options={}, @persisted=false>, "color"=>"light-teal", "followers"=>[]}, @prefix_options={}, @persisted=true>
I dont understand why this is not returning the tasks as documented in the read me. If anyone can shed any light on this I would be hugely grateful.
Is there a way to filter Asana::Project.find(project_id) tasks by status like completed, not completed?
I have been trying to adapt this gem to support the Authorization: Bearer $TOKEN method for authenticating using a token retrieved from OAuth.
I was able to hack in the header, but since the gem uses a singleton, every call to Asana::Anything will use the same credentials. In a common use case, this means one user's credentials can be set, and then another user in another session can use those credentials.
This seems a little backwards... IMHO the gem should /only/ support per-session authentication, since that's the most common use case.
To do this, we'd instantiate a new Asana object and pass it a $TOKEN or $API_KEY, that object would then use the supplied credentials for the life of the object. Calling Asana:: module directly shouldn't be allowed.
You can take a look at my modifications here: http://github.com/tronathan/asana - I'm happy to do the work to make this work as an instance object, but I need some pointers. Not sure how to make ActiveResource work that way.
This is an excellent gem, but I can't use it without support for Teams.
Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.
How did I find you?
I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well
Hi,
I tried forking and playing around, but can't figure it out.
I the "completed" attribute of each task or the ability to limit tasks to just those where completed = false.
Any idea how to do this? @rbright @seansu4you87
Thanks so much for all of the work done so far!
Could you give an example on how to find a user by their email address
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.