Example #1
0
File: issue.go Project: cou929/zhb
func findEstimate(client *zenhub.Client, issueNumber int) (*Estimate, error) {
	estimates, err := client.GetEstimates(issueNumber)
	if err != nil {
		return nil, err
	}

	for _, v := range estimates {
		if v.Selected {
			return &Estimate{Value: v.Value}, nil
		}
	}

	return nil, nil
}
Example #2
0
File: issue.go Project: cou929/zhb
func findPipeline(client *zenhub.Client, issueNumber int) (*Pipeline, error) {
	pipelines, err := client.GetPipelines(issueNumber)
	if err != nil {
		return nil, err
	}

	for _, v := range pipelines {
		if v.IsIn {
			return &Pipeline{Id: v.Id, Name: v.Name}, nil
		}
	}

	return nil, nil
}
Example #3
0
File: issue.go Project: cou929/zhb
func findPluses(client *zenhub.Client, issueNmber int, repoId int) (*[]Plus, error) {
	pluses, err := client.GetPluses(issueNmber, repoId)
	if err != nil {
		return nil, err
	}

	res := make([]Plus, len(pluses), len(pluses))
	for i, v := range pluses {
		p := Plus{
			Id:           v.Id,
			Comment:      v.Comment,
			ZenhubUserId: v.User.Id,
			GithubUserId: v.User.GithubUserInfo.Id,
			UserName:     v.User.GithubUserInfo.Name,
			CreatedAt:    v.CreatedAt,
		}
		res[i] = p
	}

	return &res, nil
}