jiracommonapi

package
v3.1.12+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const IssueCommentsExpandParam = "renderedBody"

Variables

This section is empty.

Functions

func AddComment

func AddComment(qc QueryContext, issueID, body string) (_ *work.IssueComment, rerr error)

func AssignUser

func AssignUser(qc QueryContext, issueID, accountID string) error

func ConvertComment

func ConvertComment(qc QueryContext, data CommentResponse, issueIDOrKeyOptional string, issueKeysOptional *IssueKeys) (_ *work.IssueComment, rerr error)

func EditPriority

func EditPriority(qc QueryContext, issueID, priorityID string) error

func EditStatus

func EditStatus(qc QueryContext, issueID, transitionID string, fieldValues map[string]string) error

func EditTitle

func EditTitle(qc QueryContext, issueID, title string) error

func GetIssueTransitions

func GetIssueTransitions(qc QueryContext, issueID string) (res []mutate.IssueTransition, rerr error)

func IssueTypes

func IssueTypes(qc QueryContext) (res []work.IssueType, rerr error)

func IssuesAndChangelogsPage

func IssuesAndChangelogsPage(
	qc QueryContext,
	project Project,
	fieldByID map[string]CustomField,
	updatedSince time.Time,
	paginationParams url.Values) (
	pi PageInfo,
	resIssues []IssueWithCustomFields,

	rerr error)

IssuesAndChangelogsPage returns issues and related changelogs. Calls qc.ExportUser for each user. Current difference from jira-cloud version is that user.Key is used instead of user.AccountID everywhere.

func Labels

func Labels(qc QueryContext) (res []string, rerr error)

func PaginateStartAt

func PaginateStartAt(fn PaginateStartAtFn) error

func ParsePlannedDate

func ParsePlannedDate(ts string) (time.Time, error)

func ParseTime

func ParseTime(ts string) (time.Time, error)

func Priorities

func Priorities(qc QueryContext) (res []work.IssuePriority, rerr error)

func Resolution

func Resolution(qc QueryContext) (res []string, rerr error)

func ServerVersion

func ServerVersion(qc QueryContext) (serverVersion string, err error)

Types

type AllowedValue

type AllowedValue struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Avatars

type Avatars struct {
	XSmall string `json:"16x16"`
	Small  string `json:"24x24"`
	Medium string `json:"32x32"`
	Large  string `json:"48x48"`
}

Avatars is a type that describes a set of avatar image properties

type CommentResponse

type CommentResponse struct {
	Self   string `json:"self"`
	ID     string `json:"id"`
	Author struct {
		Key       string `json:"key"`       // hosted,cloud
		AccountID string `json:"accountID"` // cloud only
	} `json:"author"`
	RenderedBody string `json:"renderedBody"`
	Created      string `json:"created"`
	Updated      string `json:"updated"`
}

type CustomField

type CustomField struct {
	ID   string
	Name string
}

type CustomFieldValue

type CustomFieldValue struct {
	ID    string
	Name  string
	Value string
}

type Field

type Field struct {
	Key           string         `json:"key"`
	Name          string         `json:"name"`
	Required      bool           `json:"required"`
	AllowedValues []AllowedValue `json:"allowedValues"`
}

type IssueKeys

type IssueKeys struct {
	ProjectRefID string
	IssueRefID   string
	IssueKey     string
}

func GetIssueKeys

func GetIssueKeys(qc QueryContext, issueIDOrKey string) (res IssueKeys, rerr error)

type IssueWithCustomFields

type IssueWithCustomFields struct {
	*work.Issue
	CustomFields []CustomFieldValue
}

func IssueByID

func IssueByID(qc QueryContext, issueIDOrKey string) (_ IssueWithCustomFields, rerr error)

BUG: returned data will have missing start and end date, because we don't pass fieldsByID here Will also be missing story points and epic link

type PageInfo

type PageInfo struct {
	Total      int
	MaxResults int
	HasMore    bool
}

func IssueComments

func IssueComments(
	qc QueryContext,
	project Project,
	issueRefID string,
	issueKey string,
	paginationParams url.Values) (pi PageInfo, resIssueComments []*work.IssueComment, rerr error)

type PaginateStartAtFn

type PaginateStartAtFn func(paginationParams url.Values) (hasMore bool, pageSize int, _ error)

type Project

type Project struct {
	JiraID string
	Key    string
}

type QueryContext

type QueryContext struct {
	WebsiteURL  string
	Logger      hclog.Logger
	CustomerID  string
	ExportUser  func(user User) error
	Req         Requester
	IsOnPremise bool
}

func (QueryContext) IssueCommentURL

func (s QueryContext) IssueCommentURL(issueKey string, commentID string) string

func (QueryContext) IssueID

func (s QueryContext) IssueID(refID string) string

func (QueryContext) IssueURL

func (s QueryContext) IssueURL(issueKey string) string

func (QueryContext) ProjectID

func (s QueryContext) ProjectID(refID string) string

func (QueryContext) ProjectURL

func (s QueryContext) ProjectURL(projectKey string) string

func (QueryContext) SprintID

func (s QueryContext) SprintID(refID string) string

func (QueryContext) UserID

func (s QueryContext) UserID(refID string) string

func (QueryContext) Validate

func (s QueryContext) Validate()

type Requester

type Requester interface {
	// Get and Get2 are for Get requests only
	Get(objPath string, params url.Values, res interface{}) error
	Get2(objPath string, params url.Values, res interface{}) (statusCode int, _ error)

	// JSON supports more configuration of request params
	JSON(req requests2.Request, res interface{}) (_ requests2.Result, rerr error)

	URL(objPath string) string
}

type StatusDetail

type StatusDetail struct {
	Name           string `json:"name"`
	StatusCategory struct {
		Key  string `json:"key"`
		Name string `json:"name"`
	} `json:"statusCategory"`
}

func StatusWithDetail

func StatusWithDetail(qc QueryContext) (_ []StatusDetail, names []string, _ error)

type User

type User struct {
	// AccountID not available in hosted jira.
	AccountID    string  `json:"accountId"`
	Self         string  `json:"self"`
	Name         string  `json:"name"`
	Key          string  `json:"key"`
	EmailAddress string  `json:"emailAddress"`
	Avatars      Avatars `json:"avatarUrls"`
	DisplayName  string  `json:"displayName"`
	Active       bool    `json:"active"`
	Timezone     string  `json:"timeZone"`

	Groups struct {
		Groups []UserGroup `json:"items,omitempty"`
	} `json:"groups"`
}

func (User) IsZero

func (s User) IsZero() bool

func (User) RefID

func (s User) RefID() string

type UserGroup

type UserGroup struct {
	Name string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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