Class: SupportOps::GitLab::Issues

Inherits:
Base
  • Object
show all
Defined in:
lib/support_ops_gitlab/gitlab/issues.rb

Overview

TODO:
TODO:
TODO:

Defines the class Issues within the module SupportOps::GitLab.

Author:

  • Jason Colyer

Since:

  • 1.0.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#activate!, #approve!, attributes, #badges, #ban!, #block!, client, #client=, #commits, configure, #contributors, #create_support_pin!, #deactivate!, define_attributes, #diffs, #disable_2fa!, #discussions, #emails, #encoded_path, #events, #find, #find!, #gpg_keys, #hard_delete!, #impersonations, #initialize, #issues, #jobs, #latest_pipeline, #members, #memberships, #paid?, #pats, #pipeline_variables, #pipelines, #preferences, #projects, readonly_attributes, #reject!, #revoke!, #rotate!, #ssh_keys, #status, #store_original_attributes, #support_pin, to_hash, #tokens, #unban!, #unblock!, #webhooks

Constructor Details

This class inherits a constructor from SupportOps::GitLab::Base

Instance Attribute Details

Various links related to the issue

Returns:

  • (Hash)

    the current value of _links



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def _links
  @_links
end

#add_labelsString

Comma-separated label names to add to an issue; if a label does not already exist, this creates a new project label and assigns it to the issue

Returns:

  • (String)

    the current value of add_labels



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def add_labels
  @add_labels
end

#assignee_idsArray

The IDs of the users to assign the issue to

Returns:

  • (Array)

    the current value of assignee_ids



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def assignee_ids
  @assignee_ids
end

#assigneesArray

An array of users assigned to the issue

Returns:

  • (Array)

    the current value of assignees



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def assignees
  @assignees
end

#authorHash

The author of the issue

Returns:

  • (Hash)

    the current value of author



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def author
  @author
end

#closed_atString

The timestamp the issue was closed at

Returns:

  • (String)

    the current value of closed_at



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def closed_at
  @closed_at
end

#closed_byHash

The user who closed the issue

Returns:

  • (Hash)

    the current value of closed_by



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def closed_by
  @closed_by
end

#confidentialBoolean

If the issue is confidential or not

Returns:

  • (Boolean)

    the current value of confidential



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def confidential
  @confidential
end

#created_atString

The timestamp of when the issue was created

Returns:

  • (String)

    the current value of created_at



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def created_at
  @created_at
end

#descriptionString

The issue’s description

Returns:

  • (String)

    the current value of description



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def description
  @description
end

#discussion_lockedBoolean

If discussion on the issue is locked or not

Returns:

  • (Boolean)

    the current value of discussion_locked



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def discussion_locked
  @discussion_locked
end

#discussion_to_resolveString

The ID of a discussion to resolve; this fills out the issue with a default description and mark the discussion as resolved

Returns:

  • (String)

    the current value of discussion_to_resolve



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def discussion_to_resolve
  @discussion_to_resolve
end

#downvotesInteger

The number of downvotes the issue has

Returns:

  • (Integer)

    the current value of downvotes



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def downvotes
  @downvotes
end

#due_dateString

The due date

Returns:

  • (String)

    the current value of due_date



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def due_date
  @due_date
end

#epicHash

the epic the issue is attached to

Returns:

  • (Hash)

    the current value of epic



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def epic
  @epic
end

#epic_idInteger

The ID of the epic the issue is attached to

Returns:

  • (Integer)

    the current value of epic_id



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def epic_id
  @epic_id
end

#epic_iidInteger

IID of the epic to add the issue to

Returns:

  • (Integer)

    the current value of epic_iid



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def epic_iid
  @epic_iid
end

#has_tasksBoolean

If the issue has attached tasks or not

Returns:

  • (Boolean)

    the current value of has_tasks



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def has_tasks
  @has_tasks
end

#health_statusString

The current health status of the issue

Returns:

  • (String)

    the current value of health_status



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def health_status
  @health_status
end

#idInteger

The global ID or URL-encoded path of the project

Returns:

  • (Integer)

    the current value of id



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def id
  @id
end

#iidInteger

The internal ID of a project’s issue

Returns:

  • (Integer)

    the current value of iid



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def iid
  @iid
end

#importedBoolean

If the issue was imported or not

Returns:

  • (Boolean)

    the current value of imported



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def imported
  @imported
end

#imported_fromString

Returns the current value of imported_from.

Returns:

  • (String)

    the current value of imported_from



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def imported_from
  @imported_from
end

#issue_typeString

The type of issue; either issue, incident, test_case, or task

Returns:

  • (String)

    the current value of issue_type



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def issue_type
  @issue_type
end

#iterationHash

The iteration the issue is in

Returns:

  • (Hash)

    the current value of iteration



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def iteration
  @iteration
end

#labelsArray

Comma-separated list of label names

Returns:

  • (Array)

    the current value of labels



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def labels
  @labels
end

#merge_request_to_resolve_discussions_ofInteger

The IID of a merge request in which to resolve all issues

Returns:

  • (Integer)

    the current value of merge_request_to_resolve_discussions_of



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def merge_request_to_resolve_discussions_of
  @merge_request_to_resolve_discussions_of
end

#merge_requests_countInteger

The number of merge requests attached to the issue4

Returns:

  • (Integer)

    the current value of merge_requests_count



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def merge_requests_count
  @merge_requests_count
end

#milestoneHash

The milestone the issue is attached to

Returns:

  • (Hash)

    the current value of milestone



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def milestone
  @milestone
end

#milestone_idInteger

The ID ofthe milestone the issue is attached to

Returns:

  • (Integer)

    the current value of milestone_id



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def milestone_id
  @milestone_id
end

#moved_to_idInteger

The ID of the new issue the current issue was moved to

Returns:

  • (Integer)

    the current value of moved_to_id



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def moved_to_id
  @moved_to_id
end

#project_idInteger

The ID of the project the issue is within

Returns:

  • (Integer)

    the current value of project_id



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def project_id
  @project_id
end

#referencesHash

Reference tags for the issue

Returns:

  • (Hash)

    the current value of references



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def references
  @references
end

#remove_labelsString

Comma-separated label names to remove from an issue

Returns:

  • (String)

    the current value of remove_labels



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def remove_labels
  @remove_labels
end

#severityString

Returns the current value of severity.

Returns:

  • (String)

    the current value of severity



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def severity
  @severity
end

#stateString

The current state of the issue

Returns:

  • (String)

    the current value of state



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def state
  @state
end

#state_eventString

The state event of an issue; to close the issue, use close, and to reopen it, use reopen

Returns:

  • (String)

    the current value of state_event



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def state_event
  @state_event
end

#task_completion_statusHash

Informaiton on the task status of an issue

Returns:

  • (Hash)

    the current value of task_completion_status



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def task_completion_status
  @task_completion_status
end

#task_statusString

A string of the task status of an issue

Returns:

  • (String)

    the current value of task_status



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def task_status
  @task_status
end

#time_statsHash

Information on the time spent on the issue

Returns:

  • (Hash)

    the current value of time_stats



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def time_stats
  @time_stats
end

#titleString

The issue title

Returns:

  • (String)

    the current value of title



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def title
  @title
end

#to_project_idInteger

The ID of the new project to move the issue to

Returns:

  • (Integer)

    the current value of to_project_id



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def to_project_id
  @to_project_id
end

#typeString

The type of issue; either issue, incident, test_case, or task

Returns:

  • (String)

    the current value of type



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def type
  @type
end

#updated_atString

The timestamp of when the issue was last updated

Returns:

  • (String)

    the current value of updated_at



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def updated_at
  @updated_at
end

#upvotesInteger

The number of upvotes on an issue

Returns:

  • (Integer)

    the current value of upvotes



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def upvotes
  @upvotes
end

#user_notes_countInteger

The number of notes on the issue

Returns:

  • (Integer)

    the current value of user_notes_count



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def user_notes_count
  @user_notes_count
end

#web_urlString

The URL of the issue

Returns:

  • (String)

    the current value of web_url



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def web_url
  @web_url
end

#weightInteger

The weight of an issue

Returns:

  • (Integer)

    the current value of weight



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def weight
  @weight
end

#with_notesBoolean

Clone the issue with notes

Returns:

  • (Boolean)

    the current value of with_notes



68
69
70
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 68

def with_notes
  @with_notes
end

Class Method Details

.get(object) ⇒ Object

Locates a specific issue in the GitLab system

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.com/api/v4'
  config.token = 'abc123'
end

issue = SupportOps::GitLab::Issues.get(987654)
pp issue.title
# => "Awesome issue"
pp issue.id
# => 28
pp issue.project_id
# => 123456
require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.com/api/v4'
  config.token = 'abc123'
end

issue = SupportOps::GitLab::Issues.get(iid: 28, project_id: 123456)
pp issue.title
# => "Awesome issue"
pp issue.id
# => 987654

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



444
445
446
447
448
449
450
451
452
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 444

def self.get(object)
  if object.is_a? Issues
    Issues.new(id: id).find
  elsif object.is_a? Hash
    Issues.new({ id: object[:id], iid: object[:iid], project_id: object[:project_id] }).find
  else
    Issues.new(id: object).find
  end
end

.get!(object) ⇒ Object

Locates a specific issue in the GitLab system

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.com/api/v4'
  config.token = 'abc123'
end

issue = SupportOps::GitLab::Issues.get!(987654)
pp issue.title
# => "Awesome issue"
pp issue.id
# => 28
pp issue.project_id
# => 123456
require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.com/api/v4'
  config.token = 'abc123'
end

issue = SupportOps::GitLab::Issues.get!(iid: 28, project_id: 123456)
pp issue.title
# => "Awesome issue"
pp issue.id
# => 987654

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



491
492
493
494
495
496
497
498
499
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 491

def self.get!(object)
  if object.is_a? Issues
    Issues.new(id: id).find!
  elsif object.is_a? Hash
    Issues.new({ id: object[:id], iid: object[:iid], project_id: object[:project_id] }).find!
  else
    Issues.new(id: object).find!
  end
end

.list(key: value) ⇒ Array

Lists issues

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.url = 'https://gitlab.example.com/api/v4'
  config.token = 'abc123'
end

issues = SupportOps::GitLab::Issues.list(project_id: 123456)
pp issues.count
# => 30
pp issues.last.due_date
# => "2018-07-31"

Parameters:

  • assignee_id (Integer optional)

    Return issues assigned to the given user id; ‘None’ returns unassigned issues; ‘Any’ returns issues with an assignee.

  • assignee_username (String optional)

    Return issues assigned to the given username

  • author_id (Integer optional)

    Return issues created by the given user id

  • author_username (String optional)

    Return issues created by the given username

  • confidential (Boolean optional)

    Filter confidential or public issues

  • created_after (String optional)

    Return issues created on or after the given time; expected in ISO 8601 format (2019-03-15T08:00:00Z)

  • created_before (String optional)

    Return issues created on or before the given time; expected in ISO 8601 format (2019-03-15T08:00:00Z)

  • due_date (String optional)

    Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month; accepts: 0 (no due date), any, today, tomorrow, overdue, week, month, next_month_and_previous_two_weeks

  • epic_id (Integer optional)

    Return issues associated with the given epic ID; ‘None’ returns issues that are not associated with an epic; ‘Any’ returns issues that are associated with an epic

  • health_status (String optional)

    Return issues with the specified health_status; ‘None’ returns issues with no health status assigned, and ‘Any’ returns issues with a health status assigned

  • iids (Array optional)

    Return only the issues having the given iid

  • issue_type (String optional)

    Filter to a given type of issue; one of issue, incident, test_case or task

  • iteration_id (Integer optional)

    Return issues assigned to the given iteration ID; ‘None’ returns issues that do not belong to an iteration; ‘Any’ returns issues that belong to an iteration

  • iteration_title (String optional)

    Return issues assigned to the iteration with the given title

  • labels (String optional)

    Comma-separated list of label names, issues must have all labels to be returned; ‘None’ lists all issues with no labels; ‘Any’ lists all issues with at least one label

  • milestone (String optional)

    The milestone title; ‘None’ lists all issues with no milestone; ‘Any’ lists all issues that have an assigned milestone

  • milestone_id (String optional)

    Returns issues assigned to milestones with a given timebox value (None, Any, Upcoming, and Started); ‘None’ lists all issues with no milestone; ‘Any’ lists all issues that have an assigned milestone; ‘Upcoming’ lists all issues assigned to milestones due in the future; ‘Started’ lists all issues assigned to open, started milestones

  • my_reaction_emoji (String optional)

    Return issues reacted by the authenticated user by the given emoji; ‘None returns issues not given a reaction; ’Any’ returns issues given at least one reaction

  • non_archived (Boolean optional)

    Return issues only from non-archived projects

  • order_by (String optional)

    Return issues ordered by created_at, due_date, label_priority, milestone_due, popularity, priority, relative_position, title, updated_at, or weight fields.

  • project_id (Integer optional)

    The project to scope the list to (not providing it scopes it to the whole instance)

  • scope (String optional)

    Return issues for the given scope: created_by_me, assigned_to_me or all

  • search (String optional)

    Search issues against their title and description

  • sort (String optional)

    Return issues sorted in asc or desc order

  • state (String optional)

    Return all issues or just those that are opened or closed

  • updated_after (String optional)

    Return issues updated on or after the given time; expected in ISO 8601 format (2019-03-15T08:00:00Z)

  • updated_before (String optional)

    Return issues updated on or before the given time; expected in ISO 8601 format (2019-03-15T08:00:00Z)

  • weight (Integer optional)

    Return issues with the specified weight; ‘None’ returns issues with no weight assigned; ‘Any’ returns issues with a weight assigned

  • limit (Integer optional)

    The limit to the number of users returned. Default to 0 (i.e. no limit)

Returns:

  • (Array)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 328

def self.list(**args)
  args[:assignee_id] = nil unless args[:assignee_id]
  args[:assignee_username] = nil unless args[:assignee_username]
  args[:author_id] = nil unless args[:author_id]
  args[:author_username] = nil unless args[:author_username]
  args[:confidential] = nil unless args[:confidential]
  args[:created_after] = nil unless args[:created_after]
  args[:created_before] = nil unless args[:created_before]
  args[:due_date] = nil unless args[:due_date]
  args[:epic_id] = nil unless args[:epic_id]
  args[:health_status] = nil unless args[:health_status]
  args[:iids] = nil unless args[:iids]
  args[:issue_type] = nil unless args[:issue_type]
  args[:iteration_id] = nil unless args[:iteration_id]
  args[:iteration_title] = nil unless args[:iteration_title]
  args[:labels] = nil unless args[:labels]
  args[:milestone] = nil unless args[:milestone]
  args[:milestone_id] = nil unless args[:milestone_id]
  args[:my_reaction_emoji] = nil unless args[:my_reaction_emoji]
  args[:non_archived] = nil unless args[:non_archived]
  args[:order_by] = nil unless args[:order_by]
  args[:project_id] = nil unless args[:project_id]
  args[:scope] = nil unless args[:scope]
  args[:search] = nil unless args[:search]
  args[:sort] = nil unless args[:sort]
  args[:state] = nil unless args[:state]
  args[:updated_after] = nil unless args[:updated_after]
  args[:updated_before] = nil unless args[:updated_before]
  args[:weight] = nil unless args[:weight]
  args[:limit] = 0 unless args[:limit]
  params = ''
  params += "assignee_id=#{args[:assignee_id]}&" unless args[:assignee_id].nil?
  params += "assignee_username=#{args[:assignee_username]}&" unless args[:assignee_username].nil?
  params += "author_id=#{args[:author_id]}&" unless args[:author_id].nil?
  params += "author_username=#{args[:author_username]}&" unless args[:author_username].nil?
  params += "confidential=#{args[:confidential]}&" unless args[:confidential].nil?
  params += "created_after=#{args[:created_after]}&" unless args[:created_after].nil?
  params += "created_before=#{args[:created_before]}&" unless args[:created_before].nil?
  params += "due_date=#{args[:due_date]}&" unless args[:due_date].nil?
  params += "epic_id=#{args[:epic_id]}&" unless args[:epic_id].nil?
  params += "health_status=#{args[:health_status]}&" unless args[:health_status].nil?
  params += "iids=#{args[:iids]}&" unless args[:iids].nil?
  params += "issue_type=#{args[:issue_type]}&" unless args[:issue_type].nil?
  params += "iteration_id=#{args[:iteration_id]}&" unless args[:iteration_id].nil?
  params += "iteration_title=#{args[:iteration_title]}&" unless args[:iteration_title].nil?
  params += "labels=#{args[:labels]}&" unless args[:labels].nil?
  params += "milestone=#{args[:milestone]}&" unless args[:milestone].nil?
  params += "milestone_id=#{args[:milestone_id]}&" unless args[:milestone_id].nil?
  params += "my_reaction_emoji=#{args[:my_reaction_emoji]}&" unless args[:my_reaction_emoji].nil?
  params += "non_archived=#{args[:non_archived]}&" unless args[:non_archived].nil?
  params += "order_by=#{args[:order_by]}&" unless args[:order_by].nil?
  params += "scope=#{args[:scope]}&" unless args[:scope].nil?
  params += "search=#{args[:search]}&" unless args[:search].nil?
  params += "sort=#{args[:sort]}&" unless args[:sort].nil?
  params += "state=#{args[:state]}&" unless args[:state].nil?
  params += "updated_after=#{args[:updated_after]}&" unless args[:updated_after].nil?
  params += "updated_before=#{args[:updated_before]}&" unless args[:updated_before].nil?
  params += "weight=#{args[:weight]}&" unless args[:weight].nil?
  array = []
  page = 1
  base_url = if args[:project_id].nil?
               "issues"
             else
              "projects/#{args[:project_id]}/issues"
             end
  loop do
    response = client.connection.get("#{base_url}?#{params}&page=#{page}&per_page=100")
    body = Oj.load(response.body)
    array += body.map { |i| Issues.new(i) }
    break if args[:limit].to_i.positive? && array.count >= args[:limit].to_i
    break if body.count < 100

    page += 1
  end
  return array if args[:limit].to_i.zero?
  
  array.first(args[:limit].to_i)
end

Instance Method Details

#delete!Object

Note:

This is inherited from Base#delete!

Deletes an issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 123456)
existing_issue.delete!

Returns:

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



20
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 20

def delete!; end

#merge_requestsBoolean

Note:

This is inherited from Base#merge_requests

List merge requests related to issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 789)
merge_requests = existing_issue.merge_requests
pp merge_requests.count
# => 4

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 22

def merge_requests; end

#move!Object

Note:

This is inherited from Base#move!

Moves an issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 123456)
existing_issue.to_project_id = 789
existing_issue.move!
pp existing_issue.to_project_id
#=> 789

Returns:

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



23
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 23

def move!; end

#notesBoolean

Note:

This is inherited from Base#notes

List notes on an issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 789)
notes = existing_issue.notes
pp notes.count
# => 7

Returns:

  • (Boolean)

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



22
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 22

def notes; end

#save!Object

Note:

This is inherited from Base#save!

Creates/updates an issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

new_issue = SupportOps::GitLab::Issues.new
new_issue.project_id = 123456
new_issue.title = 'the printer is on fire (again)'
new_issue.description = 'We need to put it out and stop this from happening again'

new_issue.save!
pp new_issue.iid
#=> 13
pp new_issue.title
#=> "the printer is on fire (again)"
require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 123456)
existing_issue.title = 'The printer has completely burned down'
existing_issue.description = 'Guess we need a new printer now'

existing_issue.save!
pp existing_issue.iid
#=> 13
pp existing_issue.title
#=> "The printer has completely burned down"

Returns:

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



48
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 48

def save!; end

#subscribe!Object

Note:

This is inherited from Base#subscribe!

Subscribe to an issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 789)
existing_issue.subscribe!

Returns:

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



20
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 20

def subscribe!; end

#unsubscribe!Object

Note:

This is inherited from Base#unsubscribe!

Unsubscribe to an issue

Examples:

require 'support_ops_gitlab'

SupportOps::GitLab::Configuration.configure do |config|
  config.token = ENV.fetch('GL_TOKEN')
  config.url = 'https://gitlab.com/api/v4'
end

existing_issue = SupportOps::GitLab::Issues.get!(iid: 13, project_id: 789)
existing_issue.unsubscribe!

Returns:

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



20
# File 'lib/support_ops_gitlab/gitlab/issues.rb', line 20

def unsubscribe!; end