Skip to content

Commit

Permalink
add example script for sprintly
Browse files Browse the repository at this point in the history
  • Loading branch information
florapdx committed Dec 1, 2014
1 parent 6961d19 commit 9c4d56f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Samples/sprintly.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Sprintly is a project management software-as-a-service product
// designed to bridge the communication gap between developers and team managers.
// With Sprintly, you can manage development projects and track team progress in real-time.
// Learn more about Sprintly's feature set and integrations at https://sprint.ly

// We recently released a Javascript SDK for accessing Sprintly data via our Python-based API.
// Find the code and additional documentation at https://github.com/sprintly/sprintly-data.
// Documentation for the Python API can be found at https://sprintly.uservoice.com/knowledgebase/topics/15784-api


// This example pulls all of the items in your project backlog and logs their count.
// Note: you need a Sprintly account and at least one product with some tasks ('items')
// added to it in order to get started.

// Install the SDK via npm: $ npm install --save sprintly/sprintly-data
var sprintly = require('sprintly-data');

var email = window.prompt('sprintly email:');
var apiKey = window.prompt('sprintly API key:');

// Initialize the sprintly client
// The client returns a products Backbone collection as well as a user Backbone model
var client = sprintly.createClient(email, apiKey);

// Fetch your Sprintly products' data. (note: returns jquery promise)
// Get the product that you'd like to pull items from.
var products = client.products.fetch();
var myProduct = client.products.get(1);

// Pull in all items in your project's backlog. (note: returns jquery promise)
// When all backlog items are fetched, log the collection count to the console.
var backlogCollection = myProduct.getItemsByStatus('backlog');
backlogCollection.done(function() {
console.log(backlogCollection.length);
});

0 comments on commit 9c4d56f

Please sign in to comment.