class GitStoryid::JiraConfiguration
Public Class Methods
new(config)
click to toggle source
Calls superclass method
GitStoryid::Configuration::new
# File lib/git_storyid.rb, line 284 def initialize(config) super(config) end
Public Instance Methods
client()
click to toggle source
# File lib/git_storyid.rb, line 299 def client @client end
fetch_all_stories()
click to toggle source
# File lib/git_storyid.rb, line 307 def fetch_all_stories client.Issue.jql("assignee=#{username} and status not in (done) and project = #{@config[:project_id]}") end
find_story_by_id(key)
click to toggle source
# File lib/git_storyid.rb, line 311 def find_story_by_id(key) if key.to_i.to_s == key.to_s # no project_id in key key = [@config[:project_id], key].join("-") end serialize_issue(client.Issue.find(key)) rescue JIRA::HTTPError => e if e.code.to_i == 404 nil else raise e end end
serialize_issue(issue)
click to toggle source
# File lib/git_storyid.rb, line 324 def serialize_issue(issue) SerializedIssue.new(issue.key, issue.issuetype.name, issue.summary) end
setup_api_client()
click to toggle source
# File lib/git_storyid.rb, line 288 def setup_api_client require 'jira-ruby' @client ||= JIRA::Client.new( :username => username, :password => @config[:password], :site => @config[:site], :context_path => '', :auth_type => :basic, ) end
username()
click to toggle source
# File lib/git_storyid.rb, line 303 def username @username ||= @config[:username] end