issuesyncjira

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateComment

func CreateComment(j Client, timeout time.Duration, jIssue jira.Issue, ghComment github.IssueComment, g issuesyncgithub.Client) (jira.Comment, error)

CreateComment adds a comment to the provided JIRA issue using the fields from the provided GitHub comment. It then returns the created comment.

func CreateIssue

func CreateIssue(j Client, timeout time.Duration, issue jira.Issue) (jira.Issue, error)

CreateIssue creates a new JIRA issue according to the fields provided in the provided issue object. It returns the created issue, with all the fields provided (including e.g. ID and Key).

func GetIssue

func GetIssue(j Client, timeout time.Duration, key string) (jira.Issue, error)

GetIssue returns a single JIRA issue within the configured project according to the issue key (e.g. "PROJ-13").

func ListIssues

func ListIssues(j Client, timeout time.Duration, jiraProjectKey string, githubIdFieldId string, ghIssueIds []int64) ([]jira.Issue, error)

ListIssues returns a list of JIRA issues on the configured project which have GitHub IDs in the provided list. `ids` should be a comma-separated list of GitHub IDs.

func TryApplyTransitionWithStatusName

func TryApplyTransitionWithStatusName(j Client, issue jira.Issue, statusName string) error

func UpdateComment

func UpdateComment(j Client, timeout time.Duration, issue jira.Issue, id string, comment github.IssueComment, g issuesyncgithub.Client) (jira.Comment, error)

UpdateComment updates a comment (identified by the `id` parameter) on a given JIRA with a new body from the fields of the given GitHub comment. It returns the updated comment.

func UpdateIssue

func UpdateIssue(j Client, timeout time.Duration, issue jira.Issue) (jira.Issue, error)

UpdateIssue updates a given issue (identified by the Key field of the provided issue object) with the fields on the provided issue. It returns the updated issue as it exists on JIRA.

Types

type Client

type Client interface {
	// contains filtered or unexported methods
}

Client is a wrapper around the JIRA API clients library we use. It allows us to hide implementation details such as backoff as well as swap in other implementations, such as for dry run or test mocking.

func NewClient

func NewClient(config *cfg.Config) (Client, error)

NewClient creates a new Client and configures it with the config object provided. The type of clients created depends on the configuration; currently, it creates either a standard clients, or a dry-run clients.

type TestJiraClient

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

func NewTestClient

func NewTestClient() TestJiraClient

Jump to

Keyboard shortcuts

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