Skip to content

Commit

Permalink
(gitlab, internal) add IssueGet method
Browse files Browse the repository at this point in the history
  • Loading branch information
nkprince007 committed Dec 17, 2017
1 parent 50d2075 commit d3a760d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,21 @@ func IssueCreate(project string, opts *gitlab.CreateIssueOptions) (string, error
return mr.WebURL, nil
}

// IssueGet retrieves the issue information from a GitLab project
func IssueGet(project string, issueNum int) (*gitlab.Issue, error) {
p, err := FindProject(project)
if err != nil {
return nil, err
}

issue, _, err := lab.Issues.GetIssue(p.ID, issueNum)
if err != nil {
return nil, err
}

return issue, nil
}

// IssueList gets a list of issues on a GitLab Project
func IssueList(project string, opts *gitlab.ListProjectIssuesOptions) ([]*gitlab.Issue, error) {
if os.Getenv("DEBUG") != "" {
Expand Down

0 comments on commit d3a760d

Please sign in to comment.