Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Repository files navigation

TrackerApi

Gem VersionBuild StatusCode ClimateCoverage StatusDependency Status

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.

Installation

Add this line to your application's Gemfile:

gem'tracker_api','~> 0.2.0'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install tracker_api

Basic Usage

client=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 label

Eager Loading

See 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

TODO

  • Add missing resources and endpoints
  • Add create, update, delete for resources

Contributing

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.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Ruby Wrapper for Pivotal Tracker v5 API

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages