This project is read-only.

What is it ?

Pivotal Tracker FluentAPI is C# API that uses the Fluent pattern to connect to the PivotalTracker REST API.

How to use it ?

First create the Pivotal Tracker Facade

var token = new Token("APIKEY"); //get a pivotal API key from your Profile
var Pivotal = new PivotalTrackerFacade(token);

List all stories

Pivotal.Projects().Get(123456).Stories().All().Each(s=>Console.WriteLine("{0} : {1}", s.Name, s.Description));

List some stories

var stories = Pivotal.Projects().Get(123456).Stories().Filter("label:ui state:delivered");

Create a story

          .SetName("Hello World")

Complete sample

  • create a project
  • create a story
  • add a note
  • add an attachment
  • start a story
  • then retrieves all stories in started state

byte[] someBytes = System.Text.Encoding.ASCII.GetBytes("Hello World"); //Some bytes
            .SetName("My first project")
                    .SetName("This is my first story")
                    .SetDescription("i'am happy it's so easy !")
                        .AddNote("this is really amazing")
                        .UploadAttachment(someBytes, "attachment.txt", "text/plain")
                        .Update(story =>
                            story.Estimate = 3;
                            story.OwnedBy = story.RequestedBy;
                            story.CurrentState = StoryStateEnum.Started;
            .Filter("state:started") //search for stories
                .Do(stories =>
                    //do some display
                    foreach (var s in stories)
                        Console.WriteLine("{0}: {1} ({2})", s.Id, s.Name, s.Type);
                        foreach (var n in s.Notes)
                            Console.WriteLine("\tNote {0} ({1}): {2}", n.Id, n.Description, n.NoteDate);
            .Done() //not mandatory, just for the symmetry :)

There is many other methods. Just download the code and let's follow the Fluent API :)

More informations

Follow the project

Last edited Mar 28, 2011 at 5:34 AM by AlexandreBoyer, version 22