pivotal

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 9 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// ProjectTypePublic wraps the string of the variable name.
	ProjectTypePublic = "public"
	// ProjectTypePrivate wraps the string of the variable name.
	ProjectTypePrivate = "private"
	// ProjectTypeDemo wraps the string of the variable name.
	ProjectTypeDemo = "demo"
)
View Source
const (
	// StoryTypeFeature wraps the string enum in the variable name.
	StoryTypeFeature = "feature"
	// StoryTypeBug wraps the string enum in the variable name.
	StoryTypeBug = "bug"
	// StoryTypeChore wraps the string enum in the variable name.
	StoryTypeChore = "chore"
	// StoryTypeRelease wraps the string enum in the variable name.
	StoryTypeRelease = "release"
)
View Source
const (
	// StoryStateUnscheduled wraps the story state enum in the variable name.
	StoryStateUnscheduled = "unscheduled"
	// StoryStatePlanned wraps the story state enum in the variable name.
	StoryStatePlanned = "planned"
	// StoryStateUnstarted wraps the story state enum in the variable name.
	StoryStateUnstarted = "unstarted"
	// StoryStateStarted wraps the story state enum in the variable name.
	StoryStateStarted = "started"
	// StoryStateFinished wraps the story state enum in the variable name.
	StoryStateFinished = "finished"
	// StoryStateDelivered wraps the story state enum in the variable name.
	StoryStateDelivered = "delivered"
	// StoryStateAccepted wraps the story state enum in the variable name.
	StoryStateAccepted = "accepted"
	// StoryStateRejected wraps the story state enum in the variable name.
	StoryStateRejected = "rejected"
)
View Source
const (
	// LibraryVersion is used to give the UserAgent some additional context
	LibraryVersion = "2.0.0"
)
View Source
const PageLimit = 10

PageLimit is the number of items to fetch at once when getting paginated response.

Variables

View Source
var ErrNoTrailingSlash = errors.New("trailing slash missing")

ErrNoTrailingSlash is returned when URLs are missing the trailing slash

Functions

This section is empty.

Types

type AccountingType added in v1.3.0

type AccountingType string

AccountingType casts string values of billing types.

const (
	// AccountingTypeUnbillable wraps the string in the variable name.
	AccountingTypeUnbillable AccountingType = "unbillable"
	// AccountingTypeBillable wraps the string in the variable name.
	AccountingTypeBillable AccountingType = "billable"
	// AccountingTypeOverhead wraps the string in the variable name.
	AccountingTypeOverhead AccountingType = "overhead"
)

type Activity added in v1.5.0

type Activity struct {
	Kind               string        `json:"kind,omitempty"`
	GUID               string        `json:"guid,omitempty"`
	ProjectVersion     int           `json:"project_version,omitempty"`
	Message            string        `json:"message,omitempty"`
	Highlight          string        `json:"highlight,omitempty"`
	Changes            []Change      `json:"changes,omitempty"`
	PrimaryResources   []interface{} `json:"primary_resources,omitempty"`
	SecondaryResources []interface{} `json:"secondary_resources,omitempty"`
	Project            Project       `json:"project,omitempty"`
	PerformedBy        Person        `json:"performed_by,omitempty"`
	OccurredAt         time.Time     `json:"occurred_at,omitempty"`
}

Activity is the default response to the activity endpoint

type ActivityCursor added in v1.5.0

type ActivityCursor struct {
	// contains filtered or unexported fields
}

ActivityCursor is a localized wrapper around the client cursor implementation for iterator patterns.

func (*ActivityCursor) Next added in v1.5.0

func (c *ActivityCursor) Next() (s *Activity, err error)

Next returns the next activity.

In case there are no more activities, io.EOF is returned as an error.

type ActivityService added in v1.5.0

type ActivityService struct {
	// contains filtered or unexported fields
}

ActivityService is encasulates a client for usage by the service

func (*ActivityService) Iterate added in v1.5.0

func (service *ActivityService) Iterate(projectID int, sortOrder *string, occurredBefore *time.Time, occurredAfter *time.Time, sinceVersion *int) (c *ActivityCursor, err error)

Iterate returns a cursor that can be used to iterate over the activities specified by the filter. More stories are fetched on demand as needed.

func (*ActivityService) List added in v1.5.0

func (service *ActivityService) List(projectID int, sortOrder *string, limit *int, offset *int, occurredBefore *time.Time, occurredAfter *time.Time, sinceVersion *int) ([]*Activity, error)

List returns all activities matching the filter in case the filter is specified.

List actually sends 2 HTTP requests - one to get the total number of activities, another to retrieve the activities using the right pagination setup. The reason for this is that the filter might require to fetch all the activities at once to get the right results. The response is default sorted in DESCENDING order so leverage the sortOrder variable to control sort order.

type Blocker added in v1.5.0

type Blocker struct {
	ID          int        `json:"id,omitempty"`
	StoryID     int        `json:"story_id,omitempty"`
	PersonID    int        `json:"person_id,omitempty"`
	Description string     `json:"description,omitempty"`
	Resolved    bool       `json:"resolved,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	UpdatedAt   *time.Time `json:"updated_at,omitempty"`
}

Blocker shows the relationship between other Stories and blocking states.

type BlockerRequest added in v1.5.0

type BlockerRequest struct {
	Description string `json:"description,omitempty"`
	Resolved    *bool  `json:"resolved,omitempty"`
}

BlockerRequest is used to do Create/Update/Delete on blockers.

type Change added in v1.5.0

type Change struct {
	Kind           string      `json:"kind,omitempty"`
	ID             int         `json:"id,omitempty"`
	Name           string      `json:"name,omitempty"`
	ChangeType     string      `json:"change_type,omitempty"`
	StoryType      string      `json:"story_type,omitempty"`
	OriginalValues interface{} `json:"original_values,omitempty"`
	NewValues      interface{} `json:"new_values,omitempty"`
	URL            string      `json:"url,omitempty"`
}

Change is the base child structure of an Acitivty

type Client

type Client struct {

	// Me service
	Me *MeService

	// Project service
	Projects *ProjectService

	// Story service
	Stories *StoryService

	// Membership service
	Memberships *MembershipService

	// Iteration service
	Iterations *IterationService

	// Activity Service
	Activity *ActivityService

	// Epic Service
	Epic *EpicService
	// contains filtered or unexported fields
}

Client wraps all Pivotal Tracker services with necessary auth contexts

func NewClient

func NewClient(apiToken string) *Client

NewClient takes a Pivotal Tracker API Token (created from the project settings) and returns a default Client implementation

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

Do takes a request created from NewRequest and executes the HTTP round trip action.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlPath string, body interface{}) (*http.Request, error)

NewRequest takes an HTTP request definition and wraps it with the Client context.

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL string) error

SetBaseURL overrides the defaultBaseURL in the default Client implementation.

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(agent string)

SetUserAgent overrides the defaultUserAgent in the default Client implementation.

type Comment

type Comment struct {
	ID                  int        `json:"id,omitempty"`
	StoryID             int        `json:"story_id,omitempty"`
	EpicID              int        `json:"epic_id,omitempty"`
	PersonID            int        `json:"person_id,omitempty"`
	Text                string     `json:"text,omitempty"`
	FileAttachmentIDs   []int      `json:"file_attachment_ids,omitempty"`
	GoogleAttachmentIDs []int      `json:"google_attachment_ids,omitempty"`
	CommitType          string     `json:"commit_type,omitempty"`
	CommitIdentifier    string     `json:"commit_identifier,omitempty"`
	CreatedAt           *time.Time `json:"created_at,omitempty"`
	UpdatedAt           *time.Time `json:"updated_at,omitempty"`
}

Comment is used to show all comments associated with a Story.

type Date added in v1.3.1

type Date time.Time

Date wraps a compatible time.Time object for marshal/unmarshal operations

func (Date) MarshalJSON

func (date Date) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler() interface for the Date object

func (*Date) UnmarshalJSON added in v1.3.1

func (date *Date) UnmarshalJSON(content []byte) error

UnmarshalJSON implements the json.Unmarshaler() interface for the Date object

type Day added in v1.3.0

type Day string

Day casts string values to a custom object

const (
	// DayMonday wraps the day string of the variable name.
	DayMonday Day = "Monday"
	// DayTuesday wraps the day string of the variable name.
	DayTuesday Day = "Tuesday"
	// DayWednesday wraps the day string of the variable name.
	DayWednesday Day = "Wednesday"
	// DayThursday wraps the day string of the variable name.
	DayThursday Day = "Thursday"
	// DayFriday wraps the day string of the variable name.
	DayFriday Day = "Friday"
	// DaySaturday wraps the day string of the variable name.
	DaySaturday Day = "Saturday"
	// DaySunday wraps the day string of the variable name.
	DaySunday Day = "Sunday"
)

type Epic added in v1.5.0

type Epic struct {
	ID          int        `json:"id,omitempty"`
	ProjectID   int        `json:"project_id,omitempty"`
	Name        string     `json:"name,omitempty"`
	LabelID     int        `json:"label_id,omitempty"`
	Description string     `json:"description,omitempty"`
	CommentIDs  []int      `json:"comment_ids,omitempty"`
	FollowerIDs []int      `json:"follower_ids,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	UpdatedAt   *time.Time `json:"updated_at,omitempty"`
	AfterID     int        `json:"after_id,omitempty"`
	BeforeID    int        `json:"before_id,omitempty"`
	URL         string     `json:"url,omitempty"`
	CompletedAt *time.Time `json:"completed_at,omitempty"`
	Kind        string     `json:"kind,omitempty"`
}

Epic is the primary data object for the epic service.

type EpicCursor added in v1.5.0

type EpicCursor struct {
	// contains filtered or unexported fields
}

EpicCursor is used to implement the iterator pattern.

func (*EpicCursor) Next added in v1.5.0

func (c *EpicCursor) Next() (e *Epic, err error)

Next returns the next epic.

In case there are no more epics, io.EOF is returned as an error.

type EpicRequest added in v1.5.0

type EpicRequest struct {
	ProjectID   int       `json:"project_id,omitempty"`
	Name        string    `json:"name,omitempty"`
	Label       Label     `json:"label,omitempty"`
	LabelID     int       `json:"label_id,omitempty"`
	Description string    `json:"description,omitempty"`
	Comments    []Comment `json:"comments,omitempty"`
	CommentIDs  []int     `json:"comment_ids,omitempty"`
	Followers   []Person  `json:"followers,omitempty"`
	FollowerIDs []int     `json:"follower_ids,omitempty"`
	AfterID     int       `json:"after_id,omitempty"`
	BeforeID    int       `json:"before_id,omitempty"`
}

EpicRequest is used to get the Epics back.

type EpicService added in v1.5.0

type EpicService struct {
	// contains filtered or unexported fields
}

EpicService wraps the client context to do actions.

func (*EpicService) Create added in v1.5.0

func (service *EpicService) Create(projectID int, epic *EpicRequest) (*Epic, *http.Response, error)

Create is used to create a new Epic with an EpicRequest.

func (*EpicService) Get added in v1.5.0

func (service *EpicService) Get(projectID, epicID int) (*Epic, *http.Response, error)

Get is returns an Epic by ID.

func (*EpicService) Iterate added in v1.5.0

func (service *EpicService) Iterate(projectID int, filter string) (c *EpicCursor, err error)

Iterate returns a cursor that can be used to iterate over the epics specified by the filter. More epics are fetched on demand as needed.

func (*EpicService) List added in v1.5.0

func (service *EpicService) List(projectID int, filter string) ([]*Epic, error)

List returns all epics matching the filter in case the filter is specified.

List actually sends 2 HTTP requests - one to get the total number of epics, another to retrieve the epics using the right pagination setup. The reason for this is that the filter might require to fetch all the epics at once to get the right results. Since the response as generated by Pivotal Tracker is not always sorted when using a filter, this approach is required to get the right data. Not sure whether this is a bug or a feature.

func (*EpicService) Update added in v1.5.0

func (service *EpicService) Update(projectID, epicID int, epic *EpicRequest) (*Epic, *http.Response, error)

Update is will update an Epic with an EpicRequest.

type ErrAPI

type ErrAPI struct {
	Response *http.Response
	Err      *Error
}

ErrAPI wraps errors from API responses.

func (*ErrAPI) Error

func (err *ErrAPI) Error() string

Error implements the Error interface for the ErrAPI struct.

type ErrFieldNotSet

type ErrFieldNotSet struct {
	// contains filtered or unexported fields
}

ErrFieldNotSet wraps errors in missing fields that are required.

func (*ErrFieldNotSet) Error

func (err *ErrFieldNotSet) Error() string

Error implements the Error interface for the ErrFieldNotSet struct.

type Error

type Error struct {
	Code             string `json:"code"`
	Error            string `json:"error"`
	Requirement      string `json:"requirement"`
	GeneralProblem   string `json:"general_problem"`
	PossibleFix      string `json:"possible_fix"`
	ValidationErrors []struct {
		Field   string `json:"field"`
		Problem string `json:"problem"`
	} `json:"validation_errors"`
}

Error is the Pivotal Tracker error response API struct

type Iteration added in v1.5.0

type Iteration struct {
	Number          int        `json:"number,omitempty"`
	ProjectID       int        `json:"project_id,omitempty"`
	Length          int        `json:"length,omitempty"`
	TeamStrength    float64    `json:"team_strength,omitempty"`
	StoryIDs        []int      `json:"story_ids,omitempty"`
	Stories         []*Story   `json:"stories,omitempty"`
	Start           *time.Time `json:"start,omitempty"`
	Finish          *time.Time `json:"finish,omitempty"`
	Velocity        float64    `json:"velocity,omitempty"`
	Points          int        `json:"points,omitempty"`
	AcceptedPoints  int        `json:"accepted_points,omitempty"`
	EffectivePoints float64    `json:"effective_points,omitempty"`
	Kind            string     `json:"kind,omitempty"`
}

Iteration is the primary data object for the IterationService.

type IterationService added in v1.5.0

type IterationService struct {
	// contains filtered or unexported fields
}

IterationService wraps the client context to implement Iteration logic.

func (*IterationService) Get added in v1.5.0

func (service *IterationService) Get(projectID int, iterationNumber int) (*Iteration, *http.Response, error)

Get return an iteration from the project.

type Label

type Label struct {
	ID        int        `json:"id,omitempty"`
	ProjectID int        `json:"project_id,omitempty"`
	Name      string     `json:"name,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	Kind      string     `json:"kind,omitempty"`
}

Label is a child object of a Story. This may need to be broken out into a LabelService someday but for now is ok here.

type Me

type Me struct {
	ID                         int        `json:"id"`
	Name                       string     `json:"name"`
	Initials                   string     `json:"initials"`
	Username                   string     `json:"username"`
	TimeZone                   *TimeZone  `json:"time_zone"`
	APIToken                   string     `json:"api_token"`
	HasGoogleIdentity          bool       `json:"has_google_identity"`
	ProjectIDs                 *[]int     `json:"project_ids"`
	WorkspaceIDs               *[]int     `json:"workspace_ids"`
	Email                      string     `json:"email"`
	ReceivedInAppNotifications bool       `json:"receives_in_app_notifications"`
	CreatedAt                  *time.Time `json:"created_at"`
	UpdatedAt                  *time.Time `json:"updated_at"`
}

Me is the primary data object for the MeService.

type MeService

type MeService struct {
	// contains filtered or unexported fields
}

MeService wraps the client context for interacting with the Me logic.

func (*MeService) Get

func (service *MeService) Get() (*Me, *http.Response, error)

Get returns information about the calling user.

type MembershipService added in v1.5.0

type MembershipService struct {
	// contains filtered or unexported fields
}

MembershipService wraps the client context for interacting with project members.

func (*MembershipService) List added in v1.5.0

func (service *MembershipService) List(projectID int) ([]*ProjectMembership, *http.Response, error)

List all of the memberships in an account.

type Person

type Person struct {
	ID       int    `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Initials string `json:"initials,omitempty"`
	Username string `json:"username,omitempty"`
	Kind     string `json:"kind,omitempty"`
}

Person is a child object of Story to give assigned/reporter values.

type Project added in v1.3.0

type Project struct {
	ID                           int            `json:"id"`
	Name                         string         `json:"name"`
	Version                      int            `json:"version"`
	IterationLength              int            `json:"iteration_length"`
	WeekStartDay                 Day            `json:"week_start_day"`
	PointScale                   string         `json:"point_scale"`
	PointScaleIsCustom           bool           `json:"point_scale_is_custom"`
	BugsAndChoresAreEstimatable  bool           `json:"bugs_and_chores_are_estimatable"`
	AutomaticPlanning            bool           `json:"automatic_planning"`
	EnableTasks                  bool           `json:"enable_tasks"`
	StartDate                    *Date          `json:"start_date"`
	TimeZone                     *TimeZone      `json:"time_zone"`
	VelocityAveragedOver         int            `json:"velocity_averaged_over"`
	ShownIterationsStartTime     *time.Time     `json:"shown_iterations_start_time"`
	StartTime                    *time.Time     `json:"start_time"`
	NumberOfDoneIterationsToShow int            `json:"number_of_done_iterations_to_show"`
	HasGoogleDomain              bool           `json:"has_google_domain"`
	Description                  string         `json:"description"`
	ProfileContent               string         `json:"profile_content"`
	EnableIncomingEmails         bool           `json:"enable_incoming_emails"`
	InitialVelocity              int            `json:"initial_velocity"`
	ProjectType                  string         `json:"project_type"`
	Public                       bool           `json:"public"`
	AtomEnabled                  bool           `json:"atom_enabled"`
	CurrentIterationNumber       int            `json:"current_iteration_number"`
	CurrentVelocity              int            `json:"current_velocity"`
	CurrentVolatility            float64        `json:"current_volatility"`
	AccountID                    int            `json:"account_id"`
	AccountingType               AccountingType `json:"accounting_type"`
	Featured                     bool           `json:"featured"`
	StoryIDs                     []int          `json:"story_ids"`
	EpicIDs                      []int          `json:"epic_ids"`
	MembershipIDs                []int          `json:"membership_ids"`
	LabelIDs                     []int          `json:"label_ids"`
	IntegrationIDs               []int          `json:"integration_ids"`
	IterationOverrideNumbers     []int          `json:"iteration_override_numbers"`
	CreatedAt                    *time.Time     `json:"created_at"`
	UpdatedAt                    *time.Time     `json:"updated_at"`
}

Project is the primary data object of the ProjectService.

type ProjectMembership added in v1.5.0

type ProjectMembership struct {
	Person         Person
	ID             int        `json:"id,omitempty"`
	Kind           string     `json:"kind,omitempty"`
	AccountID      int        `json:"account_id,omitempty"`
	Owner          bool       `json:"owner,omitempty"`
	Admin          bool       `json:"admin,omitempty"`
	ProjectCreator bool       `json:"project_creator,omitempty"`
	Timekeeper     bool       `json:"timekeeper,omitempty"`
	TimeEnterer    bool       `json:"time_enterer,omitempty"`
	CreatedAt      *time.Time `json:"created_at,omitempty"`
	UpdatedAt      *time.Time `json:"updated_at,omitempty"`
}

ProjectMembership is the primary data object for the MembershipService.

type ProjectService added in v1.3.0

type ProjectService struct {
	// contains filtered or unexported fields
}

ProjectService wraps the client context for interacting with project specific details.

func (*ProjectService) Get added in v1.3.0

func (service *ProjectService) Get(projectID int) (*Project, *http.Response, error)

Get returns a specific project's information.

func (*ProjectService) List added in v1.3.0

func (service *ProjectService) List() ([]*Project, *http.Response, error)

List returns all active projects for the current user.

type Story

type Story struct {
	ID            int        `json:"id,omitempty"`
	ProjectID     int        `json:"project_id,omitempty"`
	Name          string     `json:"name,omitempty"`
	Description   string     `json:"description,omitempty"`
	Type          string     `json:"story_type,omitempty"`
	State         string     `json:"current_state,omitempty"`
	Estimate      *float64   `json:"estimate,omitempty"`
	AcceptedAt    *time.Time `json:"accepted_at,omitempty"`
	Deadline      *time.Time `json:"deadline,omitempty"`
	RequestedByID int        `json:"requested_by_id,omitempty"`
	OwnerIDs      []int      `json:"owner_ids,omitempty"`
	LabelIDs      []int      `json:"label_ids,omitempty"`
	Labels        []*Label   `json:"labels,omitempty"`
	TaskIDs       []int      `json:"task_ids,omitempty"`
	Tasks         []int      `json:"tasks,omitempty"`
	FollowerIDs   []int      `json:"follower_ids,omitempty"`
	CommentIDs    []int      `json:"comment_ids,omitempty"`
	CreatedAt     *time.Time `json:"created_at,omitempty"`
	UpdatedAt     *time.Time `json:"updated_at,omitempty"`
	BeforeID      int        `json:"before_id,omitempty"`
	AfterID       int        `json:"after_id,omitempty"`
	IntegrationID int        `json:"integration_id,omitempty"`
	ExternalID    string     `json:"external_id,omitempty"`
	URL           string     `json:"url,omitempty"`
}

Story is the top level data object for a story, it wraps multiple child objects but is the primary required for interacting with the StoryService.

type StoryCursor

type StoryCursor struct {
	// contains filtered or unexported fields
}

StoryCursor is used to implement the iterator pattern.

func (*StoryCursor) Next

func (c *StoryCursor) Next() (s *Story, err error)

Next returns the next story.

In case there are no more stories, io.EOF is returned as an error.

type StoryRequest

type StoryRequest struct {
	Name        string    `json:"name,omitempty"`
	Description string    `json:"description,omitempty"`
	Type        string    `json:"story_type,omitempty"`
	State       string    `json:"current_state,omitempty"`
	Estimate    *float64  `json:"estimate,omitempty"`
	OwnerIDs    *[]int    `json:"owner_ids,omitempty"`
	LabelIDs    *[]int    `json:"label_ids,omitempty"`
	Labels      *[]*Label `json:"labels,omitempty"`
	TaskIDs     *[]int    `json:"task_ids,omitempty"`
	Tasks       *[]int    `json:"tasks,omitempty"`
	FollowerIDs *[]int    `json:"follower_ids,omitempty"`
	CommentIDs  *[]int    `json:"comment_ids,omitempty"`
}

StoryRequest is a simplified Story object for use in Create/Update/Delete operations.

type StoryService

type StoryService struct {
	// contains filtered or unexported fields
}

StoryService wraps the client context and allows for interaction with the Pivotal Tracker Story API.

func (*StoryService) AddBlocker added in v1.5.0

func (service *StoryService) AddBlocker(projectID int, storyID int, description string) (*Blocker, *http.Response, error)

AddBlocker will add a Blocker to a Story by ID

func (*StoryService) AddComment

func (service *StoryService) AddComment(
	projectID int,
	storyID int,
	comment *Comment,
) (*Comment, *http.Response, error)

AddComment will take a Comment object and attach it to a Story.

func (*StoryService) AddTask

func (service *StoryService) AddTask(projectID, storyID int, task *Task) (*http.Response, error)

AddTask will add a new Task to a Story by ID.

func (*StoryService) Create added in v1.5.0

func (service *StoryService) Create(projectID int, story *StoryRequest) (*Story, *http.Response, error)

Create is used to make a new Story.

func (*StoryService) Get

func (service *StoryService) Get(projectID, storyID int) (*Story, *http.Response, error)

Get will obtain the details about a single Story by project and story ID.

func (*StoryService) GetByID

func (service *StoryService) GetByID(storyID int) (*Story, *http.Response, error)

GetByID will obtain the details about a single Story by the story ID only.

func (*StoryService) Iterate

func (service *StoryService) Iterate(projectID int, filter string) (c *StoryCursor, err error)

Iterate returns a cursor that can be used to iterate over the stories specified by the filter. More stories are fetched on demand as needed.

func (*StoryService) List

func (service *StoryService) List(projectID int, filter string) ([]*Story, error)

List returns all stories matching the filter in case the filter is specified.

List actually sends 2 HTTP requests - one to get the total number of stories, another to retrieve the stories using the right pagination setup. The reason for this is that the filter might require to fetch all the stories at once to get the right results. Since the response as generated by Pivotal Tracker is not always sorted when using a filter, this approach is required to get the right data. Not sure whether this is a bug or a feature.

func (*StoryService) ListBlockers added in v1.5.0

func (service *StoryService) ListBlockers(
	projectID int,
	storyID int,
) ([]*Blocker, *http.Response, error)

ListBlockers returns the list of Blockers in a Story.

func (*StoryService) ListComments added in v1.4.0

func (service *StoryService) ListComments(
	projectID int,
	storyID int,
) ([]*Comment, *http.Response, error)

ListComments returns the list of Comments in a Story.

func (*StoryService) ListOwners

func (service *StoryService) ListOwners(projectID, storyID int) ([]*Person, *http.Response, error)

ListOwners will show who is assigned to a story, returning a Person array.

func (*StoryService) ListTasks

func (service *StoryService) ListTasks(projectID, storyID int) ([]*Task, *http.Response, error)

ListTasks will get the Tasks associated with a Story by ID.

func (*StoryService) Update

func (service *StoryService) Update(projectID, storyID int, story *StoryRequest) (*Story, *http.Response, error)

Update will change details of an existing story.

func (*StoryService) UpdateBlocker added in v1.5.0

func (service *StoryService) UpdateBlocker(projectID, storyID, blockerID int, blocker *BlockerRequest) (*Blocker, *http.Response, error)

UpdateBlocker will change an existing Blocker attached to a story by ID.

type Task

type Task struct {
	ID          int        `json:"id,omitempty"`
	StoryID     int        `json:"story_id,omitempty"`
	Description string     `json:"description,omitempty"`
	Position    int        `json:"position,omitempty"`
	Complete    bool       `json:"complete,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	UpdatedAt   *time.Time `json:"updated_at,omitempty"`
}

Task is a child object of a Story.

type TimeZone

type TimeZone struct {
	OlsonName string `json:"olson_name,omitempty"`
	Offset    string `json:"offset,omitempty"`
}

TimeZone is a Pivotal Tracker object for services to return as part of the date objects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL