Class: Jira::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/jira/issue.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Issue

Returns a new instance of Issue.



8
9
10
# File 'lib/jira/issue.rb', line 8

def initialize(options = nil)
  @resource = rest_resource(options)
end

Instance Method Details

#find_all_open_assigned_issuesObject



17
18
19
20
21
22
# File 'lib/jira/issue.rb', line 17

def find_all_open_assigned_issues
  res = @resource['sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?resolution=-1&assigneeSelect=issue_current_user'].get
  doc = XmlSimple.xml_in res.to_s 
  open_issues = doc['channel'].first['item']
  issues = open_issues.map {|i| OpenStruct.new(i)}
end

#list_all_open_assigned_issuesObject



24
25
26
27
# File 'lib/jira/issue.rb', line 24

def list_all_open_assigned_issues
  issues = find_all_open_assigned_issues
  issues.map{|i| "* #{i.title}"}.join("\n")
end

#rest_resource(options) ⇒ Object



12
13
14
15
# File 'lib/jira/issue.rb', line 12

def rest_resource(options)
  RestClient.proxy = ENV['http_proxy']
  @resource = RestClient::Resource.new(options[:jira_base], options)
end