Skip to content

Get resources events #71

@statnmap

Description

@statnmap
#' @param project_id Project id
#' @param resource_id id of the resource chosen
#' @param resource Character among "issues", "merge_requests", "epics"
#' @param event Character among "iteration", "label", "milestone", "state", "weight"
gl_resource_events <- function(project_id,
                           resource_id,
                           resource = c("issues", "merge_requests", "epics"),
                           event = c("label", "iteration", "milestone", "state", "weight"),
                           ...) {
  
  resource <- match.arg(resource)
  event <- match.arg(event)
  
  if (resource == "merge_requests" & event %in% c("iteration", "weight")) {
    stop('merge_requests can not be associated with "iteration", "weight"')
  }
  if (resource == "epics" & event %in% c("iteration", "milestone", "state", "weight")) {
    stop('epics can not be associated with "iteration", "milestone", "state", "weight"')
  }
  
    gitlab(req = paste0("projects/", project_id, "/", resource,"/", resource_id, "/resource_", event,"_events"),
           verb = httr::GET, ...)

}

Exemple

gl_resource_events(project_id = project_id, 
                               resource = "issues", 
                               resource_id = resource_id, 
                               event = "label")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions