class JIRA::Resource::Agile

Public Class Methods

all(client) click to toggle source
# File lib/jira/resource/agile.rb, line 11
def self.all(client)
  response = client.get(path_base(client) + '/board')
  parse_json(response.body)
end
get_backlog_issues(client, board_id, options = {}) click to toggle source
# File lib/jira/resource/agile.rb, line 16
def self.get_backlog_issues(client, board_id, options = {})
  options[:maxResults] ||= 100
  response = client.get(path_base(client) + "/board/#{board_id}/backlog?#{hash_to_query_string(options)}")
  parse_json(response.body)
end
get_board_issues(client, board_id, options = {}) click to toggle source
# File lib/jira/resource/agile.rb, line 22
def self.get_board_issues(client, board_id, options = {})
  response = client.get(path_base(client) + "/board/#{board_id}/issue?#{hash_to_query_string(options)}")
  json = parse_json(response.body)
  # To get Issue objects with the same structure as for Issue.all
  issue_ids = json['issues'].map { |issue|
    issue['id']
  }
  client.Issue.jql("id IN(#{issue_ids.join(', ')})")
end
get_projects(client, board_id, options = {}) click to toggle source
# File lib/jira/resource/agile.rb, line 49
def self.get_projects(client, board_id, options = {})
  options[:maxResults] ||= 100
  create_meta_url = path_base(client) + "/board/#{board_id}/project"
  params = hash_to_query_string(options)

  response = client.get("#{create_meta_url}?#{params}")
  parse_json(response.body)
end
get_projects_full(client, board_id, options = {}) click to toggle source
# File lib/jira/resource/agile.rb, line 44
def self.get_projects_full(client, board_id, options = {})
  response = client.get(path_base(client) + "/board/#{board_id}/project/full")
  parse_json(response.body)
end
get_sprint_issues(client, sprint_id, options = {}) click to toggle source
# File lib/jira/resource/agile.rb, line 38
def self.get_sprint_issues(client, sprint_id, options = {})
  options[:maxResults] ||= 100
  response = client.get(path_base(client) + "/sprint/#{sprint_id}/issue?#{hash_to_query_string(options)}")
  parse_json(response.body)
end
get_sprints(client, board_id, options = {}) click to toggle source
# File lib/jira/resource/agile.rb, line 32
def self.get_sprints(client, board_id, options = {})
  options[:maxResults] ||= 100
  response = client.get(path_base(client) + "/board/#{board_id}/sprint?#{hash_to_query_string(options)}")
  parse_json(response.body)
end

Private Class Methods

path_base(client) click to toggle source

def self.find(client, key, options = {})

options[:maxResults] ||= 100
fields = options[:fields].join(',') unless options[:fields].nil?
response = client.get("/rest/api/latest/search?jql=sprint=#{key}&fields=#{fields}&maxResults=#{options[:maxResults]}")
parse_json(response.body)

end

# File lib/jira/resource/agile.rb, line 67
def self.path_base(client)
  client.options[:context_path] + '/rest/agile/1.0'
end

Private Instance Methods

path_base(client) click to toggle source
# File lib/jira/resource/agile.rb, line 71
def path_base(client)
  self.class.path_base(client)
end