Sha256: 2d4f7f540cb356e4ed99e0f0622ba7c771a52903497aed5c4d36d8d0676efdb0

Contents?: true

Size: 684 Bytes

Versions: 1

Compression:

Stored size: 684 Bytes

Contents

module Capistrano
  module Jira
    class IssueFinder
      attr_reader :issues

      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
        r = e.response
        raise FinderError,
              "#{r.class.name}; #{r.code}: #{r.message} \n #{r.body}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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