Sha256: d961ef464c8243a7b363f5091f3a58909c39a9c0e422fa76d0f4232d6c13b2db

Contents?: true

Size: 818 Bytes

Versions: 5

Compression:

Stored size: 818 Bytes

Contents

require 'jiralicious'

module Octopolo
  module Jira
    class StoryCommenter
      include ConfigWrapper

      attr_accessor :issue
      attr_accessor :comment

      def initialize(issue_id, comment)
        Jiralicious.configure do |jira_config|
          jira_config.username = config.jira_user
          jira_config.password = config.jira_password
          jira_config.uri = config.jira_url
        end
        begin
          self.issue =  Jiralicious::Issue.find issue_id
        rescue => e
           puts "Error: Invalid Jira Issue #{issue_id}" 
        end
        self.comment = comment
      end

      def perform
        begin
          issue.comments.add(comment)
        rescue => e
          puts "Error: Failed to comment on Jira Issue. \nException: #{e}"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
octopolo-1.12.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.11.4 lib/octopolo/jira/story_commenter.rb
octopolo-1.11.3 lib/octopolo/jira/story_commenter.rb
octopolo-1.11.1 lib/octopolo/jira/story_commenter.rb
octopolo-1.11.0 lib/octopolo/jira/story_commenter.rb