forked from fixitsammie/global.hackathon
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |