jira-ruby-dmg 0.1.30 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1938a22773225ef13f1c4efa3b385f52c6556b1
4
- data.tar.gz: 8f163742137211f793fc428232525c008b3313f8
3
+ metadata.gz: d37938f6a44f80d201eea0073d44ef31f88f1e48
4
+ data.tar.gz: ddd939478d231ac3731ce5f155493d4de4aa4148
5
5
  SHA512:
6
- metadata.gz: c27d1b1777e961b7267270bc5a53537c6abfa4d6f3ba8f992888e47e4a44dc6c814bf9b574f7a287f056007d316dc7943a8103a6edd201f931ebe785c3cf5671
7
- data.tar.gz: d4134ad59a5a31c69a2a9fa1231eb11b4872efd16028a7e3e42b0d190bf61e24c5c7a63e438ebc473aee42635bf0853e6bc68571d26acd93f5f8d84fb831e504
6
+ metadata.gz: 93a77ccdbe5d0864ce0b731d3a272e2fbb31f828b6972f0e83169fe8a1693c8b98e7d9e8742981e63ccc5ff73a1c5f6771b8ce26609b86c8f623d0c05d4ca546
7
+ data.tar.gz: 69280ac432b9549cb7de25d966cbd659079e3bbd855181c8fc5934c7613602a76e412af5b7b934fc154fe4e6b73547caf1fb296cc7a85f215a22ebc6a05c1d27
@@ -44,14 +44,19 @@ module JIRA
44
44
  end
45
45
  end
46
46
 
47
- def self.jql(client, jql, fields = nil)
48
- url = client.options[:rest_base_path] + "/search?jql=" + CGI.escape(jql)
49
- url += CGI.escape("&fields=#{fields.join(",")}") if fields
50
- response = client.get(url)
51
- json = parse_json(response.body)
52
- json['issues'].map do |issue|
53
- client.Issue.build(issue)
47
+ def self.jql(client, jql, fields = nil, max_results = 9999999, start_at = 0)
48
+ result_issues = []
49
+ result_count = 0
50
+
51
+ while max_results > 0 and result_count % 1000 == 0
52
+ new_issues = self.get_issues_by_jql(client, jql, fields, max_results, start_at)
53
+ result_issues += new_issues
54
+ result_count = new_issues.length
55
+ max_results -= result_count
56
+ start_at += result_count
54
57
  end
58
+
59
+ result_issues
55
60
  end
56
61
 
57
62
  def respond_to?(method_name)
@@ -70,6 +75,20 @@ module JIRA
70
75
  end
71
76
  end
72
77
 
78
+ private
79
+ def self.get_issues_by_jql(client, jql, fields, max_results, start_at)
80
+ url = client.options[:rest_base_path] + "/search?jql=" + CGI.escape(jql)
81
+ url += CGI.escape("&fields=#{fields.join(",")}") if fields
82
+ url += "&startAt=#{start_at}"
83
+ url += "&maxResults=#{max_results}"
84
+
85
+ response = client.get(url)
86
+ json = parse_json(response.body)
87
+ json['issues'].map do |issue|
88
+ client.Issue.build(issue)
89
+ end
90
+ end
91
+
73
92
  end
74
93
 
75
94
  end
data/lib/jira/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JIRA
2
- VERSION = "0.1.30"
2
+ VERSION = "0.1.31"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira-ruby-dmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - ThisIs! DMG