gl_comments: Get the comments/notes of a commit or issue

View source: R/comments.R

gl_get_commentsR Documentation

Get the comments/notes of a commit or issue

Description

Get the comments/notes of a commit or issue

Usage

gl_get_comments(project, object_type = "issue", id, note_id = c(), ...)

gl_get_issue_comments(project, id, ...)

gl_get_commit_comments(project, id, ...)

gl_comment_commit(project, id, text, ...)

gl_comment_issue(project, id, text, ...)

gl_edit_comment(project, object_type, text, ...)

gl_edit_issue_comment(project, ...)

gl_edit_commit_comment(project, ...)

Arguments

project

project name or id

object_type

one of "issue" or "commit". Snippets and merge_requests are not implemented yet.

id

id of object:

  • commits: sha

  • issues notes/comments:

    • (project-wide) id for api version 4,

    • (global) iid for api version 3

note_id

id of note

...

passed on to gitlab() API call. See Details.

text

Text of comment/note to add or edit (translates to GitLab API note/body respectively)

Details

  • gl_comment_commit: might also contain path, line and line_type (old or new) to attach the comment to a specific in a file. See https://docs.gitlab.com/ce/api/commits.html

  • gl_get_issue_comments: might also contain comment_id to get a specific comment of an issue.

Value

Tibble of comments with descriptive variables.

Examples

## Not run: 
# fill in login parameters
set_gitlab_connection(gitlab_url = "https://gitlab.com",
  private_token = Sys.getenv("GITLAB_COM_TOKEN"))
gl_get_comments(project = "<<your-project-id>>", object_type = "issue", 1)
gl_get_comments(project = "<<your-project-id>>", "commit", 
  id = "8ce5ef240123cd78c1537991e5de8d8323666b15")
gl_comment_issue(project = "<<your-project-id>>", 1, 
  text = "Almost done!")

## End(Not run)

gitlabr documentation built on Sept. 13, 2022, 5:06 p.m.