Documentation
¶
Index ¶
- Constants
- Variables
- func BacklogAPIURL(baseURL string, boardID uint, qry *BoardBacklogParams) string
- func DefaultHistogramMapTableConfig(projectKeys []string) *histogram.HistogramMapTableSetConfig
- func DefaultIssuesSetTableColumns(inclInitiative, inclEpic bool) table.ColumnDefinitionSet
- func GetCustomValueString(iss jira.Issue, customFieldKey string) (string, error)
- func GetUnmarshalCustomValue(iss jira.Issue, customFieldKey string, v *IssueCustomField) error
- func IssueFieldsCustomFieldString(fields *jira.IssueFields, id string) string
- func IssueMapProjectStatusType(iss *jira.Issue) (map[string]string, error)
- func IssueProjectkeyType(iss *jira.Issue) (string, string)
- func IssueProjectkeyTypeStatus(iss *jira.Issue) (string, string, string)
- func IssueToEpic(iss jira.Issue) (*jira.Epic, error)
- func JiraClientBasicAuth(serverURL, username, password string) (*jira.Client, error)
- func JiraClientBasicAuthGoauth(creds *goauth.CredentialsBasicAuth) (*jira.Client, error)
- func NewClientHTTPBasicAuthFile(filename, credsKey string) (hclient *http.Client, serverURL string, err error)
- func NewClientJiraBasicAuthFile(filename, credsKey string) (*jira.Client, error)
- func NewCredentialsBasicAuthGoauthFile(filename, credsKey string) (*goauth.CredentialsBasicAuth, error)
- func NewCredentialsGoauthFile(filename, credsKey string) (*goauth.Credentials, error)
- func UserJiraToOIDC(u *jira.User, serverURL string) *oidc.UserInfo
- type BacklogService
- func (svc *BacklogService) GetBacklogIssuesAll(ctx context.Context, boardID uint, jql string) (*IssuesResponse, [][]byte, error)
- func (svc *BacklogService) GetBacklogIssuesResponse(ctx context.Context, boardID uint, qry *BoardBacklogParams) (*IssuesResponse, []byte, error)
- func (svc *BacklogService) GetBacklogIssuesSetAll(ctx context.Context, boardID uint, jql string) (*IssuesSet, [][]byte, error)
- type BoardBacklogParams
- type Client
- func NewClientFromBasicAuth(serverURL, username, password string, addCustomFieldSet bool) (*Client, error)
- func NewClientFromGoauthCLI(inclAccountsOnError, addCustomFieldSet bool) (*Client, error)
- func NewClientFromGoauthCredentials(c *goauth.Credentials, addCustomFieldSet bool) (*Client, error)
- func NewClientGoauthBasicAuthFile(filename, credsKey string, addCustomFieldSet bool) (*Client, error)
- func NewClientGoauthCredentialsSetFile(filename, accountkey string, addCustomFieldSet, inclAccountsOnError bool) (*Client, error)
- func (c *Client) Inflate(addCustomFieldSet bool) error
- func (c *Client) LoadCustomFields() error
- func (c *Client) LogOrNotAny(ctx context.Context, level slog.Level, msg string, attrs ...any)
- func (c *Client) Myself(ctx context.Context) (*jira.User, *http.Response, error)
- func (c *Client) MyselfUserInfo(ctx context.Context) (*oidc.UserInfo, *jira.User, *jira.Response, error)
- type CustomCol
- type CustomField
- type CustomFieldSchema
- type CustomFieldService
- func (svc *CustomFieldService) GetCustomField(customFieldName string) (CustomField, error)
- func (svc *CustomFieldService) GetCustomFieldEpicLink() (CustomField, error)
- func (svc *CustomFieldService) GetCustomFieldSet() (*CustomFieldSet, error)
- func (svc *CustomFieldService) GetCustomFields() (CustomFields, error)
- type CustomFieldSet
- type CustomFields
- type CustomJiraProcessor
- type CustomTableCols
- type EpicsSet
- type FuncIssueToMap
- type GetQueryOptions
- type IssueCalcField
- type IssueCustomField
- type IssueMeta
- type IssueMetas
- type IssueMore
- func (im *IssueMore) AdditionalFields(additionalFieldNames []string) map[string]*string
- func (im *IssueMore) AssigneeName() string
- func (im *IssueMore) CreateTime() time.Time
- func (im *IssueMore) CreatorName() string
- func (im *IssueMore) CustomField(customFieldLabel string) (IssueCustomField, error)
- func (im *IssueMore) CustomFieldString(customFieldLabel string) (string, error)
- func (im *IssueMore) CustomFieldStringOrDefault(customFieldLabel, def string) string
- func (im *IssueMore) Description() string
- func (im *IssueMore) EpicKey() string
- func (im *IssueMore) EpicName() string
- func (im *IssueMore) EpicNameOrSummary() string
- func (im *IssueMore) Key() string
- func (im *IssueMore) KeyLinkWebMarkdown(baseURL string) string
- func (im *IssueMore) KeyURLWeb(baseURL string) string
- func (im *IssueMore) Keys() (keys []string, hasChangelog bool)
- func (im *IssueMore) LabelExists(label string, matchToLowerTrimSpace bool) bool
- func (im *IssueMore) Labels(sortAsc bool) []string
- func (im *IssueMore) Meta(serverURL string, additionalFieldNames []string) IssueMeta
- func (im *IssueMore) ParentKey() string
- func (im *IssueMore) Project() string
- func (im *IssueMore) ProjectKey() string
- func (im *IssueMore) Resolution() string
- func (im *IssueMore) ResolutionTime() time.Time
- func (im *IssueMore) Status() string
- func (im *IssueMore) Summary() string
- func (im *IssueMore) Type() string
- func (im *IssueMore) UpdateTime() time.Time
- func (im *IssueMore) Value(fieldSlug string) (string, bool)
- func (im *IssueMore) ValueOrDefault(fieldSlug, def string) string
- func (im *IssueMore) WriteFileJSON(filename string, perm os.FileMode, prefix, indent string) error
- type IssueMores
- type IssuePatchRequestBody
- type IssuePatchRequestBodyField
- type IssuePatchRequestBodyUpdate
- type IssuePatchRequestBodyUpdateLabel
- type IssueService
- func (svc *IssueService) DoTransitionWithNameAndPayload(ctx context.Context, issueID string, issue *jira.Issue, ...) error
- func (svc *IssueService) DoTransitions(ctx context.Context, issueIDs []string, opts TransitionOptionSet) error
- func (svc *IssueService) GetIssuesSetForKeys(keys []string) (*IssuesSet, error)
- func (svc *IssueService) GetTransitions(ctx context.Context, id string, expandTransitionsFields bool) (Transitions, *jira.Response, error)
- func (svc *IssueService) Issue(ctx context.Context, issueIDOrKey string, opts *GetQueryOptions) (*jira.Issue, error)
- func (svc *IssueService) IssuePatch(ctx context.Context, issueKeyOrID string, ...) (*http.Response, error)
- func (svc *IssueService) IssuePatchCustomFieldRecursive(ctx context.Context, issueKeyOrID string, iss *jira.Issue, ...) (int, error)
- func (svc *IssueService) IssuePatchLabelRecursive(ctx context.Context, issueKeyOrID string, iss *jira.Issue, label string, ...) (int, error)
- func (svc *IssueService) Issues(ctx context.Context, keys []string, _ *GetQueryOptions) (Issues, error)
- func (svc *IssueService) IssuesPatch(ctx context.Context, issueKeyOrID []string, ...) error
- func (svc *IssueService) IssuesPatchAddLabel(ctx context.Context, issues []jira.Issue, label string, skipUpdate bool) (int, error)
- func (svc *IssueService) IssuesSetAddParents(set *IssuesSet) error
- func (svc *IssueService) JQLResultsTotalCount(jql string) (int, error)
- func (svc *IssueService) JQLsAddMetadata(jqls gojira.JQLs) (gojira.JQLs, error)
- func (svc *IssueService) JQLsReportMarkdownLines(jqls gojira.JQLs, opts *gojira.JQLsReportMarkdownOpts) ([]string, error)
- func (svc *IssueService) SearchChildrenIssues(parentKeys []string) (Issues, error)
- func (svc *IssueService) SearchChildrenIssuesSet(ctx context.Context, parentKeys []string, opts *GetQueryOptions) (*IssuesSet, error)
- func (svc *IssueService) SearchIssues(jql string, retrieveAll bool) (Issues, error)
- func (svc *IssueService) SearchIssuesAPIV3(ctx context.Context, jql string, retrieveAll bool) (Issues, error)
- func (svc *IssueService) SearchIssuesByMonth(jql gojira.JQL, createdGTE, createdLT time.Time, ...) error
- func (svc *IssueService) SearchIssuesMulti(jqls ...string) (Issues, error)
- func (svc *IssueService) SearchIssuesOnPremise(jql string, retrieveAll bool) (Issues, error)
- func (svc *IssueService) SearchIssuesPages(jql string, limit, offset, maxPages int) (Issues, error)
- func (svc *IssueService) SearchIssuesSet(jql string) (*IssuesSet, error)
- func (svc *IssueService) SearchIssuesSetParents(set *IssuesSet) (*IssuesSet, error)
- func (svc *IssueService) SearchIssuesSetWithFileCache(filename string, forceReload, reloadOnError bool, cfg *gojira.Config, ...) (*IssuesSet, error)
- type Issues
- func (ii Issues) AddRank() Issues
- func (ii Issues) CountsByProjectTypeStatus() *histogram.HistogramSets
- func (ii Issues) CountsByType() map[string]int
- func (ii Issues) IssuesSet(cfg *gojira.Config) (*IssuesSet, error)
- func (ii Issues) Keys() []string
- func (ii Issues) KeysSplitVenn(keys []string) slicesutil.Venn2ResultOrdered[string]
- func (ii Issues) Metas(baseURL string, customFieldLabels []string) IssueMetas
- func (ii Issues) WriteFileJSON(filename, prefix, indent string) error
- type IssuesResponse
- type IssuesSet
- func (set *IssuesSet) Add(issues ...jira.Issue) error
- func (set *IssuesSet) AddIssuesFile(filename string) error
- func (set *IssuesSet) CountWithTypeFilter(inclTypeFilter []string) uint
- func (set *IssuesSet) Counts() map[string]map[string]uint
- func (set *IssuesSet) CountsByCustomFieldValues(customField string) (map[string]uint, error)
- func (set *IssuesSet) CountsByMetaStage(inclTypeFilter []string) map[string]uint
- func (set *IssuesSet) CountsByProject() map[string]uint
- func (set *IssuesSet) CountsByProjectAndCustomFieldValues(customField string) (*histogram.HistogramSet, error)
- func (set *IssuesSet) CountsByProjectAndMetaStage(inclTypeFilter []string) *histogram.HistogramSet
- func (set *IssuesSet) CountsByProjectKey() map[string]uint
- func (set *IssuesSet) CountsByStatus() map[string]uint
- func (set *IssuesSet) CountsByTime() map[string]uint
- func (set *IssuesSet) CountsByType(inclLeafs, inclParents bool) map[string]uint
- func (set *IssuesSet) CountsByWorkstream(wsFuncMake WorkstreamFuncMake, inclTypeFilter []string) (map[string]uint, error)
- func (set *IssuesSet) EpicKeys(customFieldID string) []string
- func (set *IssuesSet) ExportWorkstreamFilter(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, ...) (*IssuesSet, error)
- func (set *IssuesSet) ExportWorkstreamProjectkeyStatusTablePivot(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, ...) (*table.Table, error)
- func (set *IssuesSet) ExportWorkstreamTypeStatusTablePivot(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, ...) (*table.Table, error)
- func (set *IssuesSet) ExportWorkstreamXfieldStatusHistogramSets(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, ...) (*histogram.HistogramSets, error)
- func (set *IssuesSet) ExportWorkstreamXfieldStatusTablePivot(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, ...) (*table.Table, error)
- func (set *IssuesSet) FilterByKeys(keys []string, errOnUnfound bool) (*IssuesSet, error)
- func (set *IssuesSet) FilterByStatus(inclStatuses, exclStatuses []string) (*IssuesSet, error)
- func (set *IssuesSet) FilterByStatusCategory(scatsRef gojira.StatusCategories, scatsIncl []string) (*IssuesSet, error)
- func (set *IssuesSet) FilterByType(inclTypes ...string) (*IssuesSet, error)
- func (set *IssuesSet) HistogramByCustomField(cf, def string) *histogram.Histogram
- func (set *IssuesSet) HistogramByStatus() *histogram.Histogram
- func (set *IssuesSet) HistogramByStatusCategory(statusCategories gojira.StatusCategories, matchMore bool, ...) (*histogram.Histogram, error)
- func (set *IssuesSet) HistogramMap(stdKeys []string, calcFields []IssueCalcField) (*histogram.Histogram, error)
- func (set *IssuesSet) HistogramMapFunc(fn func(iss *jira.Issue) (map[string]string, error)) (*histogram.Histogram, error)
- func (set *IssuesSet) HistogramMapProjectTypeStatus() (*histogram.Histogram, error)
- func (set *IssuesSet) HistogramSet(fieldSlug1, fieldSlug2 string) *histogram.HistogramSet
- func (set *IssuesSet) HistogramSetFunc(fn func(iss *jira.Issue) (cat1 string, cat2 string)) *histogram.HistogramSet
- func (set *IssuesSet) HistogramSetProjectType() *histogram.HistogramSet
- func (set *IssuesSet) HistogramSetsFunc(fn func(iss *jira.Issue) (cat1 string, cat2 string, cat3 string)) *histogram.HistogramSets
- func (set *IssuesSet) HistogramSetsProjectTypeStatus() *histogram.HistogramSets
- func (set *IssuesSet) InflateEpicKeys(customFieldEpicLinkID string)
- func (set *IssuesSet) InflateEpics(jclient *jira.Client, customFieldIDEpicLink string) error
- func (set *IssuesSet) Issue(key string) (jira.Issue, error)
- func (set *IssuesSet) IssueFirst() (jira.Issue, error)
- func (set *IssuesSet) IssueMetas(customFieldLabels []string) IssueMetas
- func (set *IssuesSet) IssueMores(keys ...string) IssueMores
- func (set *IssuesSet) IssueOrParent(key string) (*jira.Issue, bool)
- func (set *IssuesSet) Issues(keys ...string) Issues
- func (set *IssuesSet) IssuesSetHighestType(issueType string) (*IssuesSet, error)
- func (set *IssuesSet) KeyExists(key string, inclParents bool) bool
- func (set *IssuesSet) Keys() []string
- func (set *IssuesSet) KeysByField(fieldLabel string) map[string]SliceMore
- func (set *IssuesSet) KeysFilterLabelIncl(label string, matchToLowerTrimSpace bool) []string
- func (set *IssuesSet) KeysFilterSummaryNotLike(matchesAnd []string) []string
- func (set *IssuesSet) KeysForTypes(types []string, inclBase, inclParents bool) []string
- func (set *IssuesSet) KeysParents() []string
- func (set *IssuesSet) KeysParentsPopulated() []string
- func (set *IssuesSet) KeysParentsUnpopulated() []string
- func (set *IssuesSet) Len() int
- func (set *IssuesSet) LenLineageTopKeysPopulated() int
- func (set *IssuesSet) LenLineageTopKeysUnpopulated() int
- func (set *IssuesSet) LenMap() map[string]int
- func (set *IssuesSet) LenParents() int
- func (set *IssuesSet) LenParentsPopulated() int
- func (set *IssuesSet) LenParentsUnpopulated() int
- func (set *IssuesSet) Lineage(key string, customFieldLabels []string) (IssueMetas, error)
- func (set *IssuesSet) LineageTopKeysPopulated() ([]string, error)
- func (set *IssuesSet) LineageTopKeysUnpopulated() ([]string, error)
- func (set *IssuesSet) LineageValidateKey(key string) ([]string, error)
- func (set *IssuesSet) LineageValidateSet() (popLineage []string, unpopLineage []string, allValid bool)
- func (set *IssuesSet) RetrieveChildrenOfType(client *Client, parentTypes, baseTypes []string) error
- func (set *IssuesSet) RetrieveIssues(client *Client, ids []string) error
- func (set *IssuesSet) RetrieveParents(client *Client) error
- func (set *IssuesSet) StatusesOrder() []string
- func (set *IssuesSet) Summaries(ascSort bool) []string
- func (set *IssuesSet) Table(cols CustomTableCols) (*table.Table, error)
- func (set *IssuesSet) TableDefault(customCols *CustomTableCols, inclEpic bool, initiativeType string, ...) (*table.Table, error)
- func (set *IssuesSet) TableSet(customCols *CustomTableCols, inclEpic bool, initiativeType string, ...) (*table.TableSet, error)
- func (set *IssuesSet) TableSetProjectTypeStatus(tsConfig *histogram.HistogramMapTableSetConfig) (*table.TableSet, error)
- func (set *IssuesSet) TableSimple(cols []string) (*table.Table, error)
- func (set *IssuesSet) TimeSeriesCreatedMonth() *timeseries.TimeSeries
- func (set *IssuesSet) TimeSeriesSetCreatedMonthByCustomField(cumulative, inflate, popLast bool, monthsFilter []time.Month, ...) (*timeseries.TimeSeriesSet, error)
- func (set *IssuesSet) TimeSeriesSetCreatedMonthByKey(cumulative, inflate, popLast bool, monthsFilter []time.Month, ...) (*timeseries.TimeSeriesSet, error)
- func (set *IssuesSet) TimeSeriesSetCreatedMonthByProject(cumulative, inflate, popLast bool, monthsFilter []time.Month) (*timeseries.TimeSeriesSet, error)
- func (set *IssuesSet) TimeSeriesSetCreatedMonthByResolution(cumulative, inflate, popLast bool, monthsFilter []time.Month) (*timeseries.TimeSeriesSet, error)
- func (set *IssuesSet) TimeSeriesSetCreatedMonthByStatus(cumulative, inflate, popLast bool, monthsFilter []time.Month) (*timeseries.TimeSeriesSet, error)
- func (set *IssuesSet) TimeStats() gojira.TimeStats
- func (set *IssuesSet) Types(inclBase, inclParents bool) []string
- func (set *IssuesSet) WriteFileJSON(name, prefix, indent string) error
- type IssuesSets
- func (sets *IssuesSets) AddIssuesSetFilterKeys(name string, iset *IssuesSet, keys []string, errOnUnfound bool) error
- func (sets *IssuesSets) BarChartsText(inclProgress, inclFunnel bool, startNumber *int) (string, error)
- func (sets *IssuesSets) Histogram() *histogram.Histogram
- func (sets *IssuesSets) OrderOrDefault() []string
- func (sets *IssuesSets) TableSet(tblColsMapKeys []string, contColumnName string, ...) (*table.TableSet, error)
- func (sets *IssuesSets) Upsert(setName string, set *IssuesSet)
- func (sets *IssuesSets) UpsertIssueKeys(ctx context.Context, jrClient *Client, setName string, issueKeys []string) error
- type SliceMore
- type Status
- type Transition
- type TransitionField
- type TransitionFieldAllowedValue
- type TransitionFieldSchema
- type TransitionOption
- type TransitionOptionSet
- type TransitionPayload
- type TransitionPayloadUpdate
- type Transitions
- type TransitionsAPIReponse
- type TransitionsFieldsMap
- type TranstionFieldIDOrValue
- type WorklogOperation
- type WorkstreamFuncIncl
- type WorkstreamFuncMake
Constants ¶
const ( ParamFields = "fields" ParamJQL = "jql" ParamMaxResults = "maxResults" ParamStartAt = "startAt" ParamValidateQuery = "validateQuery" )
const ( APIV2URLListCustomFields = `/rest/api/2/field` APIV3URLIssue = `/rest/api/3/issue` // /rest/api/3/issue/{issueIdOrKey} APIV3URLSearchJQL = `/rest/api/3/search/jql` StatusDone = "Done" StatusOpen = "Open" StatusCustomClosed = "Closed" MaxResults = 1000 MetaParamRank = "_rank" OperationAdd = "add" OperationRemove = "remove" TimeTimeSpent = "Time Spent" TimeTimeEstimate = "Time Estimate" TimeTimeOriginalEstimate = "Time Original Estimate" TimeAggregateTimeOriginalEstimate = "Aggregate Time Original Estimate" TimeAggregateTimeSpent = "Aggregate Time Spent" TimeAggregateTimeEstimate = "Aggregate Time Estimate" TimeTimeRemaining = "Time Remaining" TimeTimeRemainingOriginal = "Time Remaining Original" FieldSlugType = "type" FieldSlugProjectkey = "projectkey" )
const ( ExpandFieldChangelog = "changelog" ExpandFieldComment = "comment" ExpandFieldEpic = "epic" )
const APIURLMyself = "/rest/api/3/myself"
const (
CustomFieldNameEpicLink = "Epic Link"
)
Variables ¶
var ( ErrClientCannotBeNil = errors.New("client cannot be nil") ErrJiraClientCannotBeNil = errors.New("jira client cannot be nil") ErrSimpleClientCannotBeNil = errors.New("simple client cannot be nil") ErrCustomFieldLabelRequired = errors.New("custom field label is required") ErrIssueCannotBeNil = errors.New("issue cannot be nil") ErrIssueKeyCannotBeEmpty = errors.New("issue key cannot be empty") ErrKeyNotFound = errors.New("key not found") ErrIssueOrIssueKeyOrIssueIDRequired = errors.New("issue, issue id, or issue key required") ErrIssuesSetCannotBeNil = errors.New("issuesSet cannot be nil") ErrFunctionCannotBeNil = errors.New("function cannot be nil") ErrNotFound = errors.New("Issue does not exist or you do not have permission to see it.: request failed. Please analyze the request body for more details. Status code: 400") )
var ErrJiraRESTClientCannotBeNil = errors.New("rest.Client cannot be nil")
var ErrLineageNotFound = errors.New("lineage not found")
Functions ¶
func BacklogAPIURL ¶
func BacklogAPIURL(baseURL string, boardID uint, qry *BoardBacklogParams) string
BacklogAPIURL returns a backlog issues API URL described at https://docs.atlassian.com/jira-software/REST/7.3.1/ . The description is here: Returns all issues from the board's backlog, for the given board Id. This only includes issues that the user has permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. Reference: https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/board-getIssuesForBacklog
func DefaultHistogramMapTableConfig ¶
func DefaultHistogramMapTableConfig(projectKeys []string) *histogram.HistogramMapTableSetConfig
func DefaultIssuesSetTableColumns ¶
func DefaultIssuesSetTableColumns(inclInitiative, inclEpic bool) table.ColumnDefinitionSet
func GetCustomValueString ¶
GetCustomValueString attempts to return a string if either the custom value is a simple string or is an `IssueCustomField`, in which case it returns the `value` property.
func GetUnmarshalCustomValue ¶
func GetUnmarshalCustomValue(iss jira.Issue, customFieldKey string, v *IssueCustomField) error
GetUnmarshalCustomValue can be used to unmarshal a value to `IssueCustomField{}`.
func IssueFieldsCustomFieldString ¶
func IssueFieldsCustomFieldString(fields *jira.IssueFields, id string) string
IssueFieldsCustomFieldString returns a string custom field, e.g "Epic Link"
func JiraClientBasicAuth ¶
JiraClientBasicAuth creates a go-jira client with basic authentication.
func JiraClientBasicAuthGoauth ¶
func JiraClientBasicAuthGoauth(creds *goauth.CredentialsBasicAuth) (*jira.Client, error)
JiraClientBasicAuthGoauth creates a go-jira client from goauth basic credentials.
func NewClientHTTPBasicAuthFile ¶
func NewClientHTTPBasicAuthFile(filename, credsKey string) (hclient *http.Client, serverURL string, err error)
NewClientHTTPBasicAuthFile creates an HTTP client with basic auth from a goauth file.
func NewClientJiraBasicAuthFile ¶
NewClientJiraBasicAuthFile creates a go-jira client with basic auth from a goauth file.
func NewCredentialsBasicAuthGoauthFile ¶
func NewCredentialsBasicAuthGoauthFile(filename, credsKey string) (*goauth.CredentialsBasicAuth, error)
NewCredentialsBasicAuthGoauthFile reads basic auth credentials from a goauth file.
func NewCredentialsGoauthFile ¶
func NewCredentialsGoauthFile(filename, credsKey string) (*goauth.Credentials, error)
NewCredentialsGoauthFile reads credentials from a goauth credentials file.
Types ¶
type BacklogService ¶
type BacklogService struct {
Client *Client
// contains filtered or unexported fields
}
func NewBacklogService ¶
func NewBacklogService(client *Client) *BacklogService
func (*BacklogService) GetBacklogIssuesAll ¶
func (svc *BacklogService) GetBacklogIssuesAll(ctx context.Context, boardID uint, jql string) (*IssuesResponse, [][]byte, error)
func (*BacklogService) GetBacklogIssuesResponse ¶
func (svc *BacklogService) GetBacklogIssuesResponse(ctx context.Context, boardID uint, qry *BoardBacklogParams) (*IssuesResponse, []byte, error)
func (*BacklogService) GetBacklogIssuesSetAll ¶
type BoardBacklogParams ¶
type BoardBacklogParams struct {
StartAt int `url:"startAt"`
MaxResults int `url:"maxResults"`
JQL string `url:"jql"`
ValidateQuery bool `url:"validateQuery"`
Fields string `url:"fields"`
Expand string `url:"expand"`
}
func (BoardBacklogParams) URLValues ¶
func (p BoardBacklogParams) URLValues() url.Values
type Client ¶
type Client struct {
Config *gojira.Config
HTTPClient *http.Client
JiraClient *jira.Client
Logger *slog.Logger
BacklogAPI *BacklogService
CustomFieldAPI *CustomFieldService
IssueAPI *IssueService
CustomFieldSet *CustomFieldSet
// contains filtered or unexported fields
}
Client provides access to the Jira REST API. It wraps both an HTTP client for custom requests and a go-jira client for standard operations. Use one of the NewClient* functions to create a properly initialized client.
func NewClientFromBasicAuth ¶
func NewClientFromBasicAuth(serverURL, username, password string, addCustomFieldSet bool) (*Client, error)
NewClientFromBasicAuth creates a new Client using basic authentication. If addCustomFieldSet is true, custom fields are loaded during initialization.
func NewClientFromGoauthCLI ¶
NewClientFromGoauthCLI creates a new Client by interactively selecting credentials from the goauth CLI. If inclAccountsOnError is true, available accounts are shown when an error occurs during selection.
func NewClientFromGoauthCredentials ¶
func NewClientFromGoauthCredentials(c *goauth.Credentials, addCustomFieldSet bool) (*Client, error)
NewClientFromGoauthCredentials creates a new Client from goauth credentials. Currently only basic authentication is supported.
func NewClientGoauthBasicAuthFile ¶
func NewClientGoauthBasicAuthFile(filename, credsKey string, addCustomFieldSet bool) (*Client, error)
NewClientGoauthBasicAuthFile creates a new Client from a goauth credentials file using basic authentication. This is the recommended way to create a client when credentials are stored in a file.
func NewClientGoauthCredentialsSetFile ¶
func NewClientGoauthCredentialsSetFile(filename, accountkey string, addCustomFieldSet, inclAccountsOnError bool) (*Client, error)
NewClientGoauthCredentialsSetFile creates a new Client from a goauth credentials file. The accountkey specifies which account to use from the credentials set.
func (*Client) Inflate ¶
Inflate initializes the client's service APIs (BacklogAPI, CustomFieldAPI, IssueAPI). If addCustomFieldSet is true, custom fields are loaded from the Jira server.
func (*Client) LoadCustomFields ¶
LoadCustomFields fetches and caches custom field definitions from the Jira server.
func (*Client) LogOrNotAny ¶
LogOrNotAny logs a message if the client's Logger is set. This is a no-op if Logger is nil.
type CustomCol ¶
type CustomCol struct {
Name string
Slug string
Type string
Func func(im IssueMore) (string, error)
RenderSkip bool
}
func (CustomCol) NameOrSlug ¶
type CustomField ¶
type CustomField struct {
ID string `json:"id"` // "customfield_12345"
Key string `json:"key"`
Name string `json:"name"`
UntranslatedName string `json:"untranslatedName"`
Custom bool `json:"custom"`
Orderable bool `json:"orderable"`
Searchable bool `json:"searchable"`
ClauseNames []string `json:"clauseNames"`
Schema CustomFieldSchema `json:"schema"`
}
type CustomFieldSchema ¶
type CustomFieldService ¶
type CustomFieldService struct {
JRClient *Client
}
func NewCustomFieldService ¶
func NewCustomFieldService(client *Client) *CustomFieldService
func (*CustomFieldService) GetCustomField ¶
func (svc *CustomFieldService) GetCustomField(customFieldName string) (CustomField, error)
func (*CustomFieldService) GetCustomFieldEpicLink ¶
func (svc *CustomFieldService) GetCustomFieldEpicLink() (CustomField, error)
func (*CustomFieldService) GetCustomFieldSet ¶
func (svc *CustomFieldService) GetCustomFieldSet() (*CustomFieldSet, error)
func (*CustomFieldService) GetCustomFields ¶
func (svc *CustomFieldService) GetCustomFields() (CustomFields, error)
type CustomFieldSet ¶
type CustomFieldSet struct {
Data map[string]CustomField
}
func NewCustomFieldSet ¶
func NewCustomFieldSet() *CustomFieldSet
func (*CustomFieldSet) Add ¶
func (set *CustomFieldSet) Add(fields ...CustomField) error
func (*CustomFieldSet) CreateFuncIssueToMap ¶
func (set *CustomFieldSet) CreateFuncIssueToMap(fieldsWithDefaults map[string]string, useCustomFieldDisplayNames bool) FuncIssueToMap
CreateFuncIssueToMap creates a function to use with `IssuesSet.HistogramMapFunc`.
func (*CustomFieldSet) Init ¶
func (set *CustomFieldSet) Init()
type CustomFields ¶
type CustomFields []CustomField
func (CustomFields) FilterByIDs ¶
func (cfs CustomFields) FilterByIDs(ids ...string) CustomFields
func (CustomFields) FilterByNames ¶
func (cfs CustomFields) FilterByNames(names ...string) CustomFields
func (CustomFields) SortByName ¶
func (cfs CustomFields) SortByName(asc bool) CustomFields
func (CustomFields) WriteTable ¶
func (cfs CustomFields) WriteTable(w io.Writer) error
type CustomJiraProcessor ¶
type CustomJiraProcessor struct {
*IssuesSet
}
type CustomTableCols ¶
type CustomTableCols struct {
Cols []CustomCol
}
func CustomTableColsFromStrings ¶
func CustomTableColsFromStrings(cols []string) CustomTableCols
func (CustomTableCols) Names ¶
func (cols CustomTableCols) Names(defaultToSlug bool) []string
type EpicsSet ¶
func NewEpicsSet ¶
func NewEpicsSet() EpicsSet
type GetQueryOptions ¶
type GetQueryOptions struct {
ExpandChangelog bool // sent to andygrunwald SDK
XMultiSkipNotFound bool // not sent to andygrunwald SDK; used for getting multiple issues
XIncludeParents bool
}
func (GetQueryOptions) Build ¶
func (opts GetQueryOptions) Build() *jira.GetQueryOptions
Build returns a `*jira.GetQueryOptions` for the andygrunwald SDK.
type IssueCalcField ¶
type IssueCustomField ¶
type IssueCustomField struct {
ID string `json:"id"`
Self string `json:"self"`
Value string `json:"value"`
}
func GetIssueCustomValueStruct ¶
func GetIssueCustomValueStruct(iss jira.Issue) (*IssueCustomField, error)
type IssueMeta ¶
type IssueMeta struct {
AdditionalFields map[string]*string
AssigneeName string
CreateTime *time.Time
CreatorName string
EpicName string
Key string
KeyURL string
Labels []string
ParentKey string
Project string
ProjectKey string
Resolution string
Status string
Summary string
Type string
UpdateTime *time.Time
}
func (*IssueMeta) BuildKeyURL ¶
func (*IssueMeta) KeyLinkMarkdown ¶
KeyLinkMarkdown returns a link of both `Key` and `KeyURL` are non-empty,`Key` if `Key` is non-empty or an empty string if both are empty.
type IssueMetas ¶
type IssueMetas []IssueMeta
func (IssueMetas) HighestAboveEpic ¶
func (ims IssueMetas) HighestAboveEpic() *IssueMeta
HighestAboveEpic returns the highest item that follows an Epic.
func (IssueMetas) HighestEpic ¶
func (ims IssueMetas) HighestEpic() *IssueMeta
HighestEpic returns the highest most Epic.
func (IssueMetas) HighestType ¶
func (ims IssueMetas) HighestType(issueType string) *IssueMeta
type IssueMore ¶
func NewIssueMore ¶
func (*IssueMore) AdditionalFields ¶
func (*IssueMore) AssigneeName ¶
func (*IssueMore) CreateTime ¶
func (*IssueMore) CreatorName ¶
func (*IssueMore) CustomField ¶
func (im *IssueMore) CustomField(customFieldLabel string) (IssueCustomField, error)
CustomField takes a custom value key such as `customfield_12345`.`
func (*IssueMore) CustomFieldString ¶
CustomFieldString takes a custom value key such as `customfield_12345`.`
func (*IssueMore) CustomFieldStringOrDefault ¶
CustomFieldStringOrEmpty takes a custom value key such as `customfield_12345`.`
func (*IssueMore) Description ¶
func (*IssueMore) EpicNameOrSummary ¶
func (*IssueMore) KeyLinkWebMarkdown ¶
func (*IssueMore) Keys ¶
Keys returns a slice of all keys for this issue over time including the current key and all previous keys. The return slice is deduped sorted. This relies on pulling the changelog from the Jira API. NOTE: keys are sorted alphabetically, not by change date.
func (*IssueMore) LabelExists ¶
func (*IssueMore) ProjectKey ¶
func (*IssueMore) Resolution ¶
func (*IssueMore) ResolutionTime ¶
func (*IssueMore) UpdateTime ¶
func (*IssueMore) ValueOrDefault ¶
type IssueMores ¶
type IssueMores []IssueMore
func (IssueMores) Keys ¶
func (ii IssueMores) Keys(sortAsc, dedupe bool) []string
func (IssueMores) ProjectKeys ¶
func (ii IssueMores) ProjectKeys(sortAsc, dedupe bool) []string
type IssuePatchRequestBody ¶
type IssuePatchRequestBody struct {
Update *IssuePatchRequestBodyUpdate `json:"update,omitempty"`
Fields map[string]IssuePatchRequestBodyField `json:"fields,omitempty"`
}
IssuePatchRequestBody represents a API request body to patch an issue. The Jira API uses `PUT` however this struct and associated method use `Patch` to better align with API best practices for a partial update.
func NewIssuePatchRequestBodyCustomField ¶
func NewIssuePatchRequestBodyCustomField(customFieldLabel, customFieldValue string) IssuePatchRequestBody
NewIssuePatchRequestBodyCustomField returns a body for patching the Jira issue with a custom field value.
func NewIssuePatchRequestBodyLabelAddRemove ¶
func NewIssuePatchRequestBodyLabelAddRemove(label string, remove bool) IssuePatchRequestBody
NewIssuePatchRequestBodyLabelAddRemove returns a body for patching the Jira issue by adding or removing a label.
func (IssuePatchRequestBody) Validate ¶
func (body IssuePatchRequestBody) Validate() error
Validate ensures that the `add` and `remove` propererties cannot both be set at the same time.
type IssuePatchRequestBodyField ¶
type IssuePatchRequestBodyField struct {
Value string `json:"value"`
Child *IssuePatchRequestBodyField `json:"child,omitempty"`
}
FieldPatchRequestObject can be used IssuePatchRequestBody.Fields
type IssuePatchRequestBodyUpdate ¶
type IssuePatchRequestBodyUpdate struct {
Labels []IssuePatchRequestBodyUpdateLabel `json:"labels,omitempty"`
}
IssuePatchRequestBodyUpdate represntes the `labels` slice in the `update` property of an issue update request.
type IssuePatchRequestBodyUpdateLabel ¶
type IssuePatchRequestBodyUpdateLabel struct {
// cannot have both
Add *string `json:"add,omitempty"`
Remove *string `json:"remove,omitempty"`
}
IssuePatchRequestBodyUpdateLabel represents a specific label operation in the `update` property of an issue update request.
type IssueService ¶
type IssueService struct {
Client *Client
}
func NewIssueService ¶
func NewIssueService(client *Client) *IssueService
func (*IssueService) DoTransitionWithNameAndPayload ¶
func (svc *IssueService) DoTransitionWithNameAndPayload(ctx context.Context, issueID string, issue *jira.Issue, updateTransitionName string, payload *TransitionPayload) error
func (*IssueService) DoTransitions ¶
func (svc *IssueService) DoTransitions(ctx context.Context, issueIDs []string, opts TransitionOptionSet) error
func (*IssueService) GetIssuesSetForKeys ¶
func (svc *IssueService) GetIssuesSetForKeys(keys []string) (*IssuesSet, error)
Issues returns an `IssuesSet{}` given a set of keys. If no keys are provided, any empty slice is returned.
func (*IssueService) GetTransitions ¶
func (svc *IssueService) GetTransitions(ctx context.Context, id string, expandTransitionsFields bool) (Transitions, *jira.Response, error)
func (*IssueService) Issue ¶
func (svc *IssueService) Issue(ctx context.Context, issueIDOrKey string, opts *GetQueryOptions) (*jira.Issue, error)
func (*IssueService) IssuePatch ¶
func (svc *IssueService) IssuePatch(ctx context.Context, issueKeyOrID string, issueUpdateRequestBody IssuePatchRequestBody) (*http.Response, error)
IssuePatch updates fields for an issue. See more here: https://community.developer.atlassian.com/t/update-issue-custom-field-value-via-api-without-going-forge/71161
func (*IssueService) IssuePatchCustomFieldRecursive ¶
func (svc *IssueService) IssuePatchCustomFieldRecursive(ctx context.Context, issueKeyOrID string, iss *jira.Issue, customFieldLabel, customFieldValue string, processChildren bool, processChildrenTypes []string, skipUpdate bool) (int, error)
IssuePatchCustomFieldRecursive updates an issue, and optionally child issues, with a custom field value.
func (*IssueService) IssuePatchLabelRecursive ¶
func (svc *IssueService) IssuePatchLabelRecursive(ctx context.Context, issueKeyOrID string, iss *jira.Issue, label string, removeLabel, processChildren bool, processChildrenTypes []string, skipUpdate bool) (int, error)
IssuePatchLabelRecursive updates fields for an issue. See more here: https://community.developer.atlassian.com/t/update-issue-custom-field-value-via-api-without-going-forge/71161
func (*IssueService) Issues ¶
func (svc *IssueService) Issues(ctx context.Context, keys []string, _ *GetQueryOptions) (Issues, error)
Issues returns a list of issues given a set of keys. If no keys are provided, an empty slice is returned. TODO: opts parameter is currently unused; consider adding support for expand options.
func (*IssueService) IssuesPatch ¶
func (svc *IssueService) IssuesPatch(ctx context.Context, issueKeyOrID []string, issueUpdateRequestBody IssuePatchRequestBody) error
IssuesPatch updates fields for multiple issues. See more here: https://community.developer.atlassian.com/t/update-issue-custom-field-value-via-api-without-going-forge/71161
func (*IssueService) IssuesPatchAddLabel ¶
func (*IssueService) IssuesSetAddParents ¶
func (svc *IssueService) IssuesSetAddParents(set *IssuesSet) error
func (*IssueService) JQLResultsTotalCount ¶
func (svc *IssueService) JQLResultsTotalCount(jql string) (int, error)
func (*IssueService) JQLsAddMetadata ¶
JQLsAddMetadata returns all issues for a JQL query, automatically handling API pagination.
func (*IssueService) JQLsReportMarkdownLines ¶
func (svc *IssueService) JQLsReportMarkdownLines(jqls gojira.JQLs, opts *gojira.JQLsReportMarkdownOpts) ([]string, error)
JQLsReportMarkdownLines provides Markdownlines for a set of JQLs, including querying the number of results for each JQL via the Jira API.
func (*IssueService) SearchChildrenIssues ¶
func (svc *IssueService) SearchChildrenIssues(parentKeys []string) (Issues, error)
func (*IssueService) SearchChildrenIssuesSet ¶
func (svc *IssueService) SearchChildrenIssuesSet(ctx context.Context, parentKeys []string, opts *GetQueryOptions) (*IssuesSet, error)
func (*IssueService) SearchIssues ¶
func (svc *IssueService) SearchIssues(jql string, retrieveAll bool) (Issues, error)
SearchIssues returns all issues for a JQL query, automatically handling API pagination.
func (*IssueService) SearchIssuesAPIV3 ¶
func (svc *IssueService) SearchIssuesAPIV3(ctx context.Context, jql string, retrieveAll bool) (Issues, error)
SearchIssuesAPIV3 returns all issues for a JQL query using the V3 API endpoint /rest/api/3/search/jql. If retrieveAll is true, it will paginate through all results until no more issues are available.
func (*IssueService) SearchIssuesByMonth ¶
func (*IssueService) SearchIssuesMulti ¶
func (svc *IssueService) SearchIssuesMulti(jqls ...string) (Issues, error)
func (*IssueService) SearchIssuesOnPremise ¶
func (svc *IssueService) SearchIssuesOnPremise(jql string, retrieveAll bool) (Issues, error)
SearchIssuesOnPremise returns all issues for a JQL query using the legacy pagination API. This function is for Jira Server/Data Center (on-premises) deployments only. For Jira Cloud, use SearchIssues or SearchIssuesAPIV3 instead.
func (*IssueService) SearchIssuesPages ¶
func (svc *IssueService) SearchIssuesPages(jql string, limit, offset, maxPages int) (Issues, error)
SearchIssuesPage returns all issues for a JQL query, automatically handling API pagination. A `limit` value of `0` means the max results available. A `maxPages` of `0` means to retrieve all pages.
func (*IssueService) SearchIssuesSet ¶
func (svc *IssueService) SearchIssuesSet(jql string) (*IssuesSet, error)
func (*IssueService) SearchIssuesSetParents ¶
func (svc *IssueService) SearchIssuesSetParents(set *IssuesSet) (*IssuesSet, error)
type Issues ¶
func IssuesReadFileJSON ¶
func (Issues) CountsByProjectTypeStatus ¶
func (ii Issues) CountsByProjectTypeStatus() *histogram.HistogramSets
CountsByProjectTypeStatus returns a `*histogram.Histogram` with issue counts by project, type, and status. This can be used to export CSV and XLSX sheets for analysis.
func (Issues) CountsByType ¶
func (Issues) KeysSplitVenn ¶
func (ii Issues) KeysSplitVenn(keys []string) slicesutil.Venn2ResultOrdered[string]
func (Issues) WriteFileJSON ¶
WriteFileJSON outputs a JSON file that can be read in again.
type IssuesResponse ¶
type IssuesResponse struct {
Issues Issues `json:"issues" structs:"issues"`
Expand string `json:"expand"`
StartAt int `json:"startAt" structs:"startAt"`
MaxResults int `json:"maxResults" structs:"maxResults"`
Total int `json:"total" structs:"total"`
}
IssuesResponse is only a small wrapper around the Search (with JQL) method to be able to parse the results
func IssuesResponseReadFile ¶
func IssuesResponseReadFile(filename string) (*IssuesResponse, error)
func ParseIssuesResponseBytes ¶
func ParseIssuesResponseBytes(b []byte) (*IssuesResponse, error)
func ParseIssuesResponseReader ¶
func ParseIssuesResponseReader(r io.Reader) (*IssuesResponse, error)
type IssuesSet ¶
func IssuesSetReadDirIssuesFiles ¶
IssuesSetReadDirIssuesFiles reads a list of JSON issues files.
func IssuesSetReadFileJSON ¶
func NewIssuesSet ¶
func (*IssuesSet) AddIssuesFile ¶
AddIssuesFile reads a `Issues{}` JSON file and adds it to the `IssuesSet{}`.
func (*IssuesSet) CountWithTypeFilter ¶
func (*IssuesSet) Counts ¶
Counts returns a `map[string]map[string]uint{}` where the first key is the category and the second is the category value.
func (*IssuesSet) CountsByCustomFieldValues ¶
CountsByCustomFieldValues returns a list of custom field value counts where `customField` is in the format `customfield_12345`.
func (*IssuesSet) CountsByMetaStage ¶
func (*IssuesSet) CountsByProject ¶
CountsByProject returns `map[string]uint` representing issue counts by project.
func (*IssuesSet) CountsByProjectAndCustomFieldValues ¶
func (set *IssuesSet) CountsByProjectAndCustomFieldValues(customField string) (*histogram.HistogramSet, error)
func (*IssuesSet) CountsByProjectAndMetaStage ¶
func (set *IssuesSet) CountsByProjectAndMetaStage(inclTypeFilter []string) *histogram.HistogramSet
func (*IssuesSet) CountsByProjectKey ¶
CountsByProjectKey returns `map[string]uint` representing issue counts by project key.
func (*IssuesSet) CountsByStatus ¶
CountsByStatus returns `map[string]uint` representing issue counts by status.
func (*IssuesSet) CountsByTime ¶
func (*IssuesSet) CountsByType ¶
func (*IssuesSet) CountsByWorkstream ¶
func (*IssuesSet) ExportWorkstreamFilter ¶
func (set *IssuesSet) ExportWorkstreamFilter(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, customFieldLabels []string) (*IssuesSet, error)
func (*IssuesSet) ExportWorkstreamProjectkeyStatusTablePivot ¶
func (set *IssuesSet) ExportWorkstreamProjectkeyStatusTablePivot(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, useStatusCategory bool) (*table.Table, error)
func (*IssuesSet) ExportWorkstreamTypeStatusTablePivot ¶
func (set *IssuesSet) ExportWorkstreamTypeStatusTablePivot(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, useStatusCategory bool) (*table.Table, error)
func (*IssuesSet) ExportWorkstreamXfieldStatusHistogramSets ¶
func (set *IssuesSet) ExportWorkstreamXfieldStatusHistogramSets( wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, xfieldSlug string, useStatusCategory bool) (*histogram.HistogramSets, error)
func (*IssuesSet) ExportWorkstreamXfieldStatusTablePivot ¶
func (set *IssuesSet) ExportWorkstreamXfieldStatusTablePivot(wsFuncMake WorkstreamFuncMake, wsFuncIncl WorkstreamFuncIncl, xfieldSlug, xfieldName string, useStatusCategory bool) (*table.Table, error)
func (*IssuesSet) FilterByKeys ¶
func (*IssuesSet) FilterByStatus ¶
func (*IssuesSet) FilterByStatusCategory ¶
func (*IssuesSet) FilterByType ¶
func (*IssuesSet) HistogramByCustomField ¶
func (*IssuesSet) HistogramByStatus ¶
func (*IssuesSet) HistogramByStatusCategory ¶
func (set *IssuesSet) HistogramByStatusCategory(statusCategories gojira.StatusCategories, matchMore bool, customCounts map[string]int) (*histogram.Histogram, error)
HistogramByStatusCategory returns a `histogram.Histogram` based on issue counts or custom counts.
func (*IssuesSet) HistogramMap ¶
func (*IssuesSet) HistogramMapFunc ¶
func (set *IssuesSet) HistogramMapFunc(fn func(iss *jira.Issue) (map[string]string, error)) (*histogram.Histogram, error)
HistogramMapFunc provides a `*histogram.Histogram` given a provided function. The function param corresponds to `FuncIssueToMap`.
func (*IssuesSet) HistogramMapProjectTypeStatus ¶
HistogramMapProjectTypeStatus provides issue counts by: Project, Type, and Status.
func (*IssuesSet) HistogramSet ¶
func (set *IssuesSet) HistogramSet(fieldSlug1, fieldSlug2 string) *histogram.HistogramSet
HistogramSet provides a `*histogram.HistogramSets` given two histogram fields
func (*IssuesSet) HistogramSetFunc ¶
func (set *IssuesSet) HistogramSetFunc(fn func(iss *jira.Issue) (cat1 string, cat2 string)) *histogram.HistogramSet
HistogramSetFunc provides a `*histogram.HistogramSet` given a provided function.
func (*IssuesSet) HistogramSetProjectType ¶
func (set *IssuesSet) HistogramSetProjectType() *histogram.HistogramSet
HistogramSetProjectType returns a list of histograms by Project and Type.
func (*IssuesSet) HistogramSetsFunc ¶
func (set *IssuesSet) HistogramSetsFunc(fn func(iss *jira.Issue) (cat1 string, cat2 string, cat3 string)) *histogram.HistogramSets
HistogramSetsFunc provides a `*histogram.HistogramSets` given a provided function.
func (*IssuesSet) HistogramSetsProjectTypeStatus ¶
func (set *IssuesSet) HistogramSetsProjectTypeStatus() *histogram.HistogramSets
HistogramSetsProjectTypeStatus provides issue counts by: Project, Type, and Status.
func (*IssuesSet) InflateEpicKeys ¶
func (*IssuesSet) InflateEpics ¶
InflateEpics uses the Jira REST API to inflate the Issue struct with an Epic struct.
func (*IssuesSet) IssueFirst ¶
IssueFirst returns the first issue by alphabetical sorting of keys. It is primarily used for testing purposes to get an issue.
func (*IssuesSet) IssueMetas ¶
func (set *IssuesSet) IssueMetas(customFieldLabels []string) IssueMetas
func (*IssuesSet) IssueMores ¶
func (set *IssuesSet) IssueMores(keys ...string) IssueMores
func (*IssuesSet) IssueOrParent ¶
func (*IssuesSet) IssuesSetHighestType ¶
func (*IssuesSet) KeyExists ¶
KeyExists returns a boolean representing the existence of an issue key.
func (*IssuesSet) KeysByField ¶
func (*IssuesSet) KeysFilterLabelIncl ¶
func (*IssuesSet) KeysFilterSummaryNotLike ¶
func (*IssuesSet) KeysForTypes ¶
func (*IssuesSet) KeysParents ¶
func (*IssuesSet) KeysParentsPopulated ¶
ParentsPopulated returns issue ids that are in the current set or current parent set.
func (*IssuesSet) KeysParentsUnpopulated ¶
ParentsUnpopulated returns issue ids that are not in the current set or current parent set.
func (*IssuesSet) LenLineageTopKeysPopulated ¶
func (*IssuesSet) LenLineageTopKeysUnpopulated ¶
func (*IssuesSet) LenMap ¶
LenMap provides various metrics. It is useful for determining if all parents and lineages have been loaded.
func (*IssuesSet) LenParents ¶
func (*IssuesSet) LenParentsPopulated ¶
func (*IssuesSet) LenParentsUnpopulated ¶
func (*IssuesSet) Lineage ¶
func (set *IssuesSet) Lineage(key string, customFieldLabels []string) (IssueMetas, error)
Lineage returns a slice of `IssueMeta` where the supplied key is in index 0 and the most senior parent is the last element of the slice. If a parent is not found in the set, an error is returned.
func (*IssuesSet) LineageTopKeysPopulated ¶
func (*IssuesSet) LineageTopKeysUnpopulated ¶
func (*IssuesSet) LineageValidateKey ¶
LineageValidateKey returns a lineage slice where the leaf key is in index position 0 (little-endian). This is done in case a parent cannot be found in which case the boolean returned is false.
func (*IssuesSet) LineageValidateSet ¶
func (*IssuesSet) RetrieveChildrenOfType ¶
RetrieveChildrenOfType retrieves all children of supplied parent types. If the child matches a base type, it is inserted into the current `IssuesSet`. If it is not a baseType, it is inserted into `Parents`. Of note, this will only load children of parent types that are already in the `IssuesSet`.
func (*IssuesSet) RetrieveIssues ¶
func (*IssuesSet) RetrieveParents ¶
func (*IssuesSet) StatusesOrder ¶
StatusesOrder returns the status order from `StageConfig{}`.
func (*IssuesSet) TableDefault ¶
func (set *IssuesSet) TableDefault(customCols *CustomTableCols, inclEpic bool, initiativeType string, customFieldLabels []string) (*table.Table, error)
TableDefault returns a `table.Table` where each record is a Jira issue starting with a linked issue key.
func (*IssuesSet) TableSet ¶
func (set *IssuesSet) TableSet(customCols *CustomTableCols, inclEpic bool, initiativeType string, customFieldLabels []string) (*table.TableSet, error)
TableSet is designed to return a `table.TableSet` where the tables include a list of issues and optionally, epics, and/or initiatives.
func (*IssuesSet) TableSetProjectTypeStatus ¶
func (*IssuesSet) TableSimple ¶
func (*IssuesSet) TimeSeriesCreatedMonth ¶
func (set *IssuesSet) TimeSeriesCreatedMonth() *timeseries.TimeSeries
TimeSeriesCreatedMonth provides issue counts by month by create date
func (*IssuesSet) TimeSeriesSetCreatedMonthByCustomField ¶
func (set *IssuesSet) TimeSeriesSetCreatedMonthByCustomField(cumulative, inflate, popLast bool, monthsFilter []time.Month, customFieldID uint) (*timeseries.TimeSeriesSet, error)
TimeSeriesSetCreatedMonthByCustomField provides issue counts by custom field and month by create date. `customFieldID` is aunit for the integer part of `customfield_12345` or `cf[12345]`.
func (*IssuesSet) TimeSeriesSetCreatedMonthByKey ¶
func (set *IssuesSet) TimeSeriesSetCreatedMonthByKey(cumulative, inflate, popLast bool, monthsFilter []time.Month, fnKey func(iss jira.Issue) (string, error)) (*timeseries.TimeSeriesSet, error)
TimeSeriesCreatedMonth provides issue counts by month by create date
func (*IssuesSet) TimeSeriesSetCreatedMonthByProject ¶
func (set *IssuesSet) TimeSeriesSetCreatedMonthByProject(cumulative, inflate, popLast bool, monthsFilter []time.Month) (*timeseries.TimeSeriesSet, error)
TimeSeriesSetCreatedMonthByProject provides issue counts by project and month by create date
func (*IssuesSet) TimeSeriesSetCreatedMonthByResolution ¶
func (set *IssuesSet) TimeSeriesSetCreatedMonthByResolution(cumulative, inflate, popLast bool, monthsFilter []time.Month) (*timeseries.TimeSeriesSet, error)
TimeSeriesSetCreatedMonthByResolution provides issue counts by resolution and month by create date
func (*IssuesSet) TimeSeriesSetCreatedMonthByStatus ¶
func (set *IssuesSet) TimeSeriesSetCreatedMonthByStatus(cumulative, inflate, popLast bool, monthsFilter []time.Month) (*timeseries.TimeSeriesSet, error)
TimeSeriesSetCreatedMonthByStatus provides issue counts by status and month by create date
func (*IssuesSet) WriteFileJSON ¶
WriteFileJSON writes the `IssuesSet{}` as a JSON file.
type IssuesSets ¶
func NewIssuesSets ¶
func NewIssuesSets() *IssuesSets
func (*IssuesSets) AddIssuesSetFilterKeys ¶
func (*IssuesSets) BarChartsText ¶
func (sets *IssuesSets) BarChartsText(inclProgress, inclFunnel bool, startNumber *int) (string, error)
func (*IssuesSets) Histogram ¶
func (sets *IssuesSets) Histogram() *histogram.Histogram
func (*IssuesSets) OrderOrDefault ¶
func (sets *IssuesSets) OrderOrDefault() []string
func (*IssuesSets) Upsert ¶
func (sets *IssuesSets) Upsert(setName string, set *IssuesSet)
func (*IssuesSets) UpsertIssueKeys ¶
type Status ¶
func IssueStatuses ¶
func IssueStatuses() []Status
type Transition ¶
type Transition struct {
ID string `json:"id" structs:"id"`
Name string `json:"name" structs:"name"`
To jira.Status `json:"to" structs:"status"`
Fields TransitionsFieldsMap `json:"fields" structs:"fields"`
}
func (Transition) RequiredFields ¶
func (txn Transition) RequiredFields() []string
RequiredFields returns the list of reuqired fields, but it may not be complete from analyzing the API response on update.
type TransitionField ¶
type TransitionField struct {
Name string `json:"name"`
Key string `json:"key"` // e.g. "custom_12345"
Required bool `json:"required"`
Schema TransitionFieldSchema `json:"schema"`
Operations []string `json:"operations"`
AllowedValues []TransitionFieldAllowedValue `json:"allowedValues"`
}
type TransitionFieldSchema ¶
type TransitionOption ¶
type TransitionOption struct {
Name string `json:"name,omitempty"`
Payload *TransitionPayload `json:"payload,omitempty"`
}
type TransitionOptionSet ¶
type TransitionOptionSet struct {
ContinueOnUnlistedStatus bool `json:"continueOnUnlistedStatus"`
StatusToTransitionOptions map[string]TransitionOption `json:"statusToTransitionOptions,omitempty"`
}
type TransitionPayload ¶
type TransitionPayload struct {
Transition jira.TransitionPayload `json:"transition,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Update TransitionPayloadUpdate `json:"update,omitempty"`
}
type TransitionPayloadUpdate ¶
type TransitionPayloadUpdate struct {
Worklog []WorklogOperation `json:"worklog,omitempty"`
}
type Transitions ¶
type Transitions []Transition
func (Transitions) AddTransitionsSDK ¶
func (txns Transitions) AddTransitionsSDK(txnsSDK []jira.Transition)
func (Transitions) GetByName ¶
func (txns Transitions) GetByName(name string) (Transition, error)
func (Transitions) MapNameToID ¶
func (txns Transitions) MapNameToID() map[string]string
func (Transitions) Names ¶
func (txns Transitions) Names() []string
type TransitionsAPIReponse ¶
type TransitionsAPIReponse struct {
Transitions []Transition `json:"transitions"`
}
type TransitionsFieldsMap ¶
type TransitionsFieldsMap map[string]TransitionField
func (TransitionsFieldsMap) GetByName ¶
func (m TransitionsFieldsMap) GetByName(fieldName string) (TransitionField, error)
type TranstionFieldIDOrValue ¶
type WorklogOperation ¶
type WorklogOperation struct {
Add jira.WorklogRecord `json:"add"`
}
type WorkstreamFuncIncl ¶
type WorkstreamFuncMake ¶
Source Files
¶
- backlog_service.go
- client.go
- constants_urls.go
- customfield.go
- customfield_service.go
- customfield_set.go
- epic.go
- errors.go
- issue_fields_simple.go
- issue_meta.go
- issue_more.go
- issue_mores.go
- issue_service.go
- issue_service__parents.go
- issue_service__report.go
- issue_service__search.go
- issue_service__write.go
- issues.go
- issues_response.go
- issues_set.go
- issues_set__children.go
- issues_set__counts.go
- issues_set__counts_keys.go
- issues_set__filter.go
- issues_set__histograms.go
- issues_set__lineage.go
- issues_set__meta.go
- issues_set__parents.go
- issues_set__read.go
- issues_set__table.go
- issues_sets.go
- myself.go
- transition.go
- transition_api.go