From 0698255e2ecee5c187e10e3e016f7df7139989fd Mon Sep 17 00:00:00 2001 From: Ryan Sonnek Date: Mon, 18 Feb 2019 13:45:51 -0600 Subject: [PATCH] Add BoardConfiguration API 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 #316 --- lib/jira-ruby.rb | 1 + lib/jira/client.rb | 4 ++++ lib/jira/resource/board.rb | 7 +++++++ lib/jira/resource/board_configuration.rb | 9 +++++++++ 4 files changed, 21 insertions(+) create mode 100644 lib/jira/resource/board_configuration.rb diff --git a/lib/jira-ruby.rb b/lib/jira-ruby.rb index 4bfccf00..b4250cf2 100644 --- a/lib/jira-ruby.rb +++ b/lib/jira-ruby.rb @@ -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' diff --git a/lib/jira/client.rb b/lib/jira/client.rb index d9f88b06..1f619695 100644 --- a/lib/jira/client.rb +++ b/lib/jira/client.rb @@ -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 diff --git a/lib/jira/resource/board.rb b/lib/jira/resource/board.rb index 8459560b..d78ec68a 100644 --- a/lib/jira/resource/board.rb +++ b/lib/jira/resource/board.rb @@ -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) diff --git a/lib/jira/resource/board_configuration.rb b/lib/jira/resource/board_configuration.rb new file mode 100644 index 00000000..fa152f8b --- /dev/null +++ b/lib/jira/resource/board_configuration.rb @@ -0,0 +1,9 @@ +module JIRA + module Resource + class BoardConfigurationFactory < JIRA::BaseFactory # :nodoc: + end + + class BoardConfiguration < JIRA::Base + end + end +end