MCPcopy Index your code
hub / github.com/git-bug/git-bug / addCommentGitlabIssue

Function addCommentGitlabIssue

bridge/gitlab/export.go:441–456  ·  view source on GitHub ↗

add a comment to an issue and return it ID

(ctx context.Context, gc *gitlab.Client, repositoryID string, issueID int, body string)

Source from the content-addressed store, hash-verified

439
440// add a comment to an issue and return it ID
441func addCommentGitlabIssue(ctx context.Context, gc *gitlab.Client, repositoryID string, issueID int, body string) (int, error) {
442 ctx, cancel := context.WithTimeout(ctx, defaultTimeout)
443 defer cancel()
444 note, _, err := gc.Notes.CreateIssueNote(
445 repositoryID, issueID,
446 &gitlab.CreateIssueNoteOptions{
447 Body: &body,
448 },
449 gitlab.WithContext(ctx),
450 )
451 if err != nil {
452 return 0, err
453 }
454
455 return note.ID, nil
456}
457
458func editCommentGitlabIssue(ctx context.Context, gc *gitlab.Client, repositoryID string, issueID, noteID int, body string) error {
459 ctx, cancel := context.WithTimeout(ctx, defaultTimeout)

Callers 1

exportBugMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected