Sha256: b41d41e4da1c790e7173601b96a75fe26cf2cab538c9fd6e7d2039f9b592606c

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

module Capistrano
  module Jira
    class IssueFinder
      attr_reader :issues

      include ErrorHelpers

      def find!
        @issues = execute
      end

      def find
        @issues ||= execute
      end

      private

      def jql
        [
          "project = #{fetch(:jira_project_key)}",
          "status = #{fetch(:jira_status_name)}",
          fetch(:jira_filter_jql)
        ].compact.join(' AND ')
      end

      def execute
        Jira.client.Issue.jql(jql, fields: ['status'], max_results: 1_000_000)
      rescue JIRA::HTTPError => e
        raise FinderError, error_message(e)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-jira-0.2.0 lib/capistrano/jira/issue_finder.rb