Class: JiraIssues::JiraQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/jira_issues/jira_query.rb

Instance Method Summary collapse

Constructor Details

#initialize(max_results = 1000) ⇒ JiraQuery

Creates new Query object and sets the maximum number of issues returned by Query

Parameters:

  • max_results (Integer) (defaults to: 1000)

    maximum number of issues returned by query



7
8
9
# File 'lib/jira_issues/jira_query.rb', line 7

def initialize(max_results = 1000)
  @query_max_results = max_results
end

Instance Method Details

#jql_query(query) ⇒ JiraIssueNavigator

Handles a JQL Request and returns JiraIssueavigator for that query

Parameters:

  • query (String)

Returns:

  • (JiraIssueNavigator)

    with those requests



14
15
16
17
# File 'lib/jira_issues/jira_query.rb', line 14

def jql_query(query)
  result = adapter.jql(query, fields:[:description, :summary, :created, :status, :issuetype, :priority, :resolutiondate, :duedate], max_results: @query_max_results)
  JiraIssuesNavigator.new(result.map { |i| JiraIssueMapper.new.call(i) })
end