Skip to content

Commit

Permalink
Add BoardConfiguration API
Browse files Browse the repository at this point in the history
Why?
Allow for lookup of configuration information for a specific board.

See JIRA API documentation:
https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-boardId-configuration-get

Completes sumoheavy#316
  • Loading branch information
wireframe committed Feb 18, 2019
1 parent 25e896f commit 0698255
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/jira-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
require 'jira/resource/webhook'
require 'jira/resource/agile'
require 'jira/resource/board'
require 'jira/resource/board_configuration'

require 'jira/request_client'
require 'jira/oauth_client'
Expand Down
4 changes: 4 additions & 0 deletions lib/jira/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ def Board
JIRA::Resource::BoardFactory.new(self)
end

def BoardConfiguration
JIRA::Resource::BoardConfigurationFactory.new(self)
end

def RapidView
JIRA::Resource::RapidViewFactory.new(self)
end
Expand Down
7 changes: 7 additions & 0 deletions lib/jira/resource/board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ def issues(params = {})
results.map { |issue| client.Issue.build(issue) }
end

def configuration(params = {})
path = path_base(client) + "/board/#{id}/configuration"
response = client.get(url_with_query_params(path, params))
json = self.class.parse_json(response.body)
client.BoardConfiguration.build(json)
end

# options
# - state ~ future, active, closed, you can define multiple states separated by commas, e.g. state=active,closed
# - maxResults ~ default: 50 (JIRA API), 1000 (this library)
Expand Down
9 changes: 9 additions & 0 deletions lib/jira/resource/board_configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module JIRA
module Resource
class BoardConfigurationFactory < JIRA::BaseFactory # :nodoc:
end

class BoardConfiguration < JIRA::Base
end
end
end

0 comments on commit 0698255

Please sign in to comment.