Sha256: 2328a4b62808d206a98c32be5937b4587023173e9be69f1e2837422229e8ee2d

Contents?: true

Size: 812 Bytes

Versions: 12

Compression:

Stored size: 812 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 #{issue_id}" 
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
octopolo-1.9.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.8.1 lib/octopolo/jira/story_commenter.rb
octopolo-1.8.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.7.1 lib/octopolo/jira/story_commenter.rb
octopolo-1.7.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.6.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.5.3 lib/octopolo/jira/story_commenter.rb
octopolo-1.5.2 lib/octopolo/jira/story_commenter.rb
octopolo-1.5.1 lib/octopolo/jira/story_commenter.rb
octopolo-1.5.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.4.0 lib/octopolo/jira/story_commenter.rb
octopolo-1.3.0 lib/octopolo/jira/story_commenter.rb