Class: SupportOps::GitLab::Milestones
- Defined in:
- lib/support_ops_gitlab/gitlab/milestones.rb
Overview
Get single milestone => docs.gitlab.com/api/group_milestones/#get-single-milestone
Get all burndown chart events for a single milestone => docs.gitlab.com/api/group_milestones/#get-all-burndown-chart-events-for-a-single-milestone
Document #save! (create/update)
Document #delete!
Document issues
Document merge_requests
Defines the class Milestones within the module SupportOps::GitLab.
Instance Attribute Summary collapse
-
#add_labels ⇒ Array
Comma-separated label names to add to an issue.
-
#created_at ⇒ String
The date the milestone was created at.
-
#description ⇒ String
The description of the milestone.
-
#due_date ⇒ String
The date the milestone is due.
-
#expired ⇒ Boolean
If the milestone is expired or not.
-
#group_id ⇒ Integer
the ID of the group the milestone is in.
-
#id ⇒ Integer
The ID of the group milestone.
-
#iid ⇒ Integer
The internal ID of the milestone.
-
#start_date ⇒ String
The date the milestone starts on.
-
#state ⇒ String
The current state of the milestone.
-
#state_event ⇒ String
The state event of the milestone, close or activate (used for updated only).
-
#title ⇒ String
The title of the milestone.
-
#updated_at ⇒ String
The date the milestone was last updated.
-
#web_url ⇒ String
The URL of the milestone.
Class Method Summary collapse
-
.list(key: value) ⇒ Array
Lists all milestones for a group.
Methods inherited from Base
#activate!, #approve!, attributes, #badges, #ban!, #block!, client, #client=, #commits, configure, #contributors, #create_support_pin!, #deactivate!, define_attributes, #delete!, #diffs, #disable_2fa!, #discussions, #emails, #encoded_path, #events, #find, #find!, #gpg_keys, #hard_delete!, #impersonations, #initialize, #issues, #jobs, #latest_pipeline, #members, #memberships, #merge_requests, #move!, #notes, #paid?, #pats, #pipeline_variables, #pipelines, #preferences, #projects, readonly_attributes, #reject!, #revoke!, #rotate!, #save!, #ssh_keys, #status, #store_original_attributes, #subscribe!, #support_pin, to_hash, #tokens, #unban!, #unblock!, #unsubscribe!, #webhooks
Constructor Details
This class inherits a constructor from SupportOps::GitLab::Base
Instance Attribute Details
#add_labels ⇒ Array
Comma-separated label names to add to an issue
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def add_labels @add_labels end |
#created_at ⇒ String
The date the milestone was created at
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def created_at @created_at end |
#description ⇒ String
The description of the milestone
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def description @description end |
#due_date ⇒ String
The date the milestone is due
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def due_date @due_date end |
#expired ⇒ Boolean
If the milestone is expired or not
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def expired @expired end |
#group_id ⇒ Integer
the ID of the group the milestone is in
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def group_id @group_id end |
#id ⇒ Integer
The ID of the group milestone
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def id @id end |
#iid ⇒ Integer
The internal ID of the milestone
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def iid @iid end |
#start_date ⇒ String
The date the milestone starts on
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def start_date @start_date end |
#state ⇒ String
The current state of the milestone
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def state @state end |
#state_event ⇒ String
The state event of the milestone, close or activate (used for updated only)
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def state_event @state_event end |
#title ⇒ String
The title of the milestone
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def title @title end |
#updated_at ⇒ String
The date the milestone was last updated
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def updated_at @updated_at end |
#web_url ⇒ String
The URL of the milestone
32 33 34 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 32 def web_url @web_url end |
Class Method Details
.list(key: value) ⇒ Array
Lists all milestones for a group
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/support_ops_gitlab/gitlab/milestones.rb', line 90 def self.list(**args) args[:group_id] = nil unless args[:group_id] raise 'You have to provide a group_id' if args[:group_id].nil? args[:group_id] = nil unless args[:group_id] args[:end_date] = nil unless args[:end_date] args[:containing_date] = nil unless args[:containing_date] args[:iids] = nil unless args[:iids] args[:include_ancestors] = nil unless args[:include_ancestors] args[:include_descendants] = nil unless args[:include_descendants] args[:search] = nil unless args[:search] args[:search_title] = nil unless args[:search_title] args[:start_date] = nil unless args[:start_date] args[:state] = nil unless args[:state] args[:title] = nil unless args[:title] args[:updated_after] = nil unless args[:updated_after] args[:updated_before] = nil unless args[:updated_before] params = '' params += "end_date=#{args[:end_date]}&" unless args[:end_date].nil? params += "containing_date=#{args[:containing_date]}&" unless args[:containing_date].nil? params += "iids=#{args[:iids]}&" unless args[:iids].nil? params += "include_ancestors=#{args[:include_ancestors]}&" unless args[:include_ancestors].nil? params += "include_descendants=#{args[:include_descendants]}&" unless args[:include_descendants].nil? params += "search=#{args[:search]}&" unless args[:search].nil? params += "search_title=#{args[:search_title]}&" unless args[:search_title].nil? params += "start_date=#{args[:start_date]}&" unless args[:start_date].nil? params += "state=#{args[:state]}&" unless args[:state].nil? params += "title=#{args[:title]}&" unless args[:title].nil? params += "updated_after=#{args[:updated_after]}&" unless args[:updated_after].nil? params += "updated_before=#{args[:updated_before]}&" unless args[:updated_before].nil? array = [] page = 1 loop do response = client.connection.get("groups/#{args[:group_id]}/milestones?#{params}&page=#{page}&per_page=100") body = Oj.load(response.body) array += body.map { |m| Milestones.new(m) } break if body.count < 100 page += 1 end array end |