This gem allows you to easily use the Pivotal Tracker v5 API.
It’s powered by Faraday and Virtus.
##Demonstration
Dash of Agile uses tracker_api to create agile dashboards from Pivotal Tracker projects.
Add this line to your application's Gemfile:
gem'tracker_api','~> 0.2.0'And then execute:
$ bundle installOr install it yourself as:
$ gem install tracker_apiclient=TrackerApi::Client.new(token: 'my-api-token')# Create API clientclient.me.email# Get email for the authenticated personclient.activity# Get a list of all the activity performed the authenticated personclient.notifications# Get notifications for the authenticated personprojects=client.projects# Get all projectsproject=client.project(123456)# Find project with given IDproject.activity# Get a list of all the activity performed on this projectproject.stories# Get all stories for a projectproject.stories(with_state: :unscheduled,limit: 10)# Get 10 unscheduled stories for a projectproject.stories(filter: 'requester:OWK label:"jedi stuff"')# Get all stories that match the given filtersproject.create_story(name: 'Destroy death star')# Create a story with the name 'Destroy death star'story=project.story(847762630)# Find a story with the given IDstory.activity# Get a list of all the activity performed on this storystory.name='Save the Ewoks'# Update a single story attributestory.attributes={name: 'Save the Ewoks',description: '...'}# Update multiple story attributesstory.labels << TrackerApi::Resources::Label.new(name: 'Endor')# Add a new label to an existing storystory.save# Save changes made to a storyepics=project.epics# Get all epics for a projectepic=epics.firstlabel=epic.label# Get an epic's labelSee Pivotal Tracker API documentation for how to use the fields parameter.
client=TrackerApi::Client.new(token: 'my-api-token')# Create API clientclient.project(project_id,fields: ':default,labels(name)')# Eagerly get labels with a projectclient.project(project_id,fields: ':default,epics')# Eagerly get epics with a projectclient.project(project_id).stories(fields: ':default,tasks')# Eagerly get stories with tasksclient.project.stories(fields: ':default,comments(:default,person)')# Eagerly get stories with comments and the person that made the commentstory.comments(fields: ':default,person')# Eagerly get comments and the person that made the comment for a story- Add missing resources and endpoints
- Add create, update, delete for resources
Currently this client supports read-only access to Pivotal Tracker. We will be extending it as our use cases require, but are always happy to accept contributions.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request