Documentation
¶
Index ¶
- Constants
- Variables
- func GetToken() (string, error)
- func OpenInEditor(s string, d string) (string, string, error)
- func SetToken(key string) (string, error)
- type Attrs
- type Component
- type Components
- type Content
- type ContentBlock
- type CreateIssueRequest
- type CreatedIssueResponse
- type Description
- type Field
- type Fields
- type Issue
- type IssueConfig
- type Issuetype
- type JQLSearchRequest
- type JQLSearchResponse
- type JTConfig
- type JiraClient
- type JiraConfig
- type Parent
- type Project
Constants ¶
View Source
const ( IssueTypeBug = "Bug" IssueTypeTask = "Task" IssueTypeStory = "Story" IssueTypeEpic = "Epic" IssueTypeSubTask = "Sub-task" IssueTypeInitiative = "Initiative" )
View Source
const (
DefaultConfigLocation = "~/.config/jt/config.yaml"
)
View Source
const (
DefaultEditor = "vim"
)
Variables ¶
View Source
var (
ErrEmptySummary = fmt.Errorf("aborting, summary empty")
)
Functions ¶
func OpenInEditor ¶
OpenInEditor opens the user's default editor and returns the contents of the file.
Types ¶
type Components ¶
type Content ¶
type Content struct {
Type string `json:"type,omitempty"`
Content []ContentBlock `json:"content,omitempty"`
}
type ContentBlock ¶
type CreateIssueRequest ¶
type CreatedIssueResponse ¶
type CreatedIssueResponse struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self"`
Transition struct {
Status int `json:"status"`
ErrorCollection struct {
ErrorMessages []string `json:"errorMessages"`
Errors struct{} `json:"errors"`
} `json:"errorCollection"`
} `json:"transition"`
ErrorMessages []string `json:"errorMessages"`
Errors map[string]string `json:"errors"`
}
type Description ¶
type Fields ¶
type Fields struct {
Components []Components `json:"components,omitempty"`
Issuetype Issuetype `json:"issuetype,omitempty"`
Parent *Parent `json:"parent,omitempty"`
Project Project `json:"project,omitempty"`
Description *Description `json:"description,omitempty"`
Summary string `json:"summary,omitempty"`
}
type IssueConfig ¶ added in v1.1.0
type JQLSearchRequest ¶ added in v1.1.0
type JQLSearchResponse ¶ added in v1.1.0
type JTConfig ¶
type JTConfig struct {
// URL is the URL of the JIRA instance.
URL string `yaml:"url"`
// Email is the JIRA user email. Used as a username for authenticating.
Email string `yaml:"email"`
// Default project key is the JIRA project that will be used for issues. This is the short version of a project name, example: PRJ.
DefaultProjectKey string `yaml:"defaultProjectKey"`
// Default issue type is the issue type that will be used for issues.
DefaultIssueType string `yaml:"defaultIssueType"`
// Default component names are the default components that will be added to issues.
DefaultComponentNames []string `yaml:"defaultComponentNames"`
// Default parent issue types are the issue types that will be searched for when querying for parent issues.
DefaultParentIssueTypes []string `yaml:"defaultParentIssueTypes"`
}
func ReadConfig ¶
ReadConfig reads config file from the default location.
type JiraClient ¶
type JiraClient struct {
// contains filtered or unexported fields
}
func NewJiraClient ¶
func NewJiraClient(conf JiraConfig) *JiraClient
func (JiraClient) NewJIRAIssue ¶ added in v1.1.0
func (jc JiraClient) NewJIRAIssue(conf IssueConfig) (string, error)
NewJIRAIssue creates a new JIRA issue using the JIRA REST API v3. The function returns the key of the created issue and an error if the issue could not be created. https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post
func (JiraClient) SearchJiraIssues ¶ added in v1.1.0
func (jc JiraClient) SearchJiraIssues(jqlReq JQLSearchRequest) ([]Issue, error)
SearchJiraIssues searches for JIRA issues using the JIRA REST API v3. The function returns a slice of JQLSearchResponse and an error if the search request failed.
type JiraConfig ¶
Click to show internal directories.
Click to hide internal directories.