// CommentIssue comments on jira issues with a pre-defined comment
CommentIssue comments on jira issues with a pre-defined comment
// CommentIssue comments on jira issues with a pre - defined comment
func (j *jiraIssueProvider) CommentIssue(i issue) (ok bool) {
	if !config.UserSettingEnabled(i.Owner, config.IssueComments) {
		return
	}
	jiraIssue, _, err := j.c.Issue.Get(i.ID, nil)
	if err != nil {
		log.Printf("unable to retrieve issue: '%s': %v. %s", i.ID, err, config.CheckMessage(
			config.JiraUser,
			"Ensure JIRA_AUTH_TOKEN belongs to the user.",
		))
		return
	}
	comment := j.genComment(jiraIssue)
	if comment == nil {
		ok = true
		return
	}
	_, _, err = j.c.Issue.AddComment(i.ID, comment)
	if err != nil {
		log.Printf("unable to leave comment on issue: '%s': %v", i.ID, err)
	}
	ok = err == nil
	return
}
func ( j * jiraIssueProvider ) CommentIssue ( i issue ) ( ok bool ) { if ! config . UserSettingEnabled ( i . Owner , config . IssueComments ) { return } jiraIssue , _ , err := j . c . Issue . Get ( i . ID , nil ) if err != nil { log . Printf ( " " , i . ID , err , config . CheckMessage ( config . JiraUser , " " , ) ) return } comment := j . genComment ( jiraIssue ) if comment == nil { ok = true return } _ , _ , err = j . c . Issue . AddComment ( i . ID , comment ) if err != nil { log . Printf ( " " , i . ID , err ) } ok = err == nil return }
CommentIssue comments on jira issues with a pre-defined comment
CommentIssue comments on jira issues with a pre - defined comment