jira-ruby 2.3.0 → 3.2.0
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 +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +20 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/CI.yml +30 -0
- data/.github/workflows/codeql.yml +96 -0
- data/.github/workflows/rubocop.yml +18 -0
- data/.gitignore +3 -1
- data/.rubocop.yml +123 -0
- data/.yardopts +4 -0
- data/Gemfile +11 -3
- data/Guardfile +2 -0
- data/README.md +94 -19
- data/Rakefile +3 -4
- data/jira-ruby.gemspec +12 -17
- data/lib/jira/atlassian/jwt.rb +76 -0
- data/lib/jira/base.rb +37 -36
- data/lib/jira/base_factory.rb +4 -1
- data/lib/jira/client.rb +132 -51
- data/lib/jira/has_many_proxy.rb +32 -28
- data/lib/jira/http_client.rb +80 -13
- data/lib/jira/http_error.rb +4 -0
- data/lib/jira/jwt_client.rb +19 -43
- data/lib/jira/oauth_client.rb +68 -3
- data/lib/jira/railtie.rb +2 -0
- data/lib/jira/request_client.rb +31 -2
- data/lib/jira/resource/agile.rb +7 -9
- data/lib/jira/resource/applinks.rb +5 -3
- data/lib/jira/resource/attachment.rb +144 -4
- data/lib/jira/resource/board.rb +5 -3
- data/lib/jira/resource/board_configuration.rb +2 -0
- data/lib/jira/resource/comment.rb +14 -0
- data/lib/jira/resource/component.rb +2 -0
- data/lib/jira/resource/createmeta.rb +7 -5
- data/lib/jira/resource/field.rb +13 -12
- data/lib/jira/resource/filter.rb +2 -0
- data/lib/jira/resource/issue.rb +148 -54
- data/lib/jira/resource/issue_picker_suggestions.rb +4 -1
- data/lib/jira/resource/issue_picker_suggestions_issue.rb +2 -0
- data/lib/jira/resource/issuelink.rb +6 -3
- data/lib/jira/resource/issuelinktype.rb +2 -0
- data/lib/jira/resource/issuetype.rb +2 -0
- data/lib/jira/resource/priority.rb +2 -0
- data/lib/jira/resource/project.rb +4 -2
- data/lib/jira/resource/properties.rb +56 -0
- data/lib/jira/resource/rapidview.rb +5 -3
- data/lib/jira/resource/remotelink.rb +2 -0
- data/lib/jira/resource/resolution.rb +2 -0
- data/lib/jira/resource/serverinfo.rb +2 -0
- data/lib/jira/resource/sprint.rb +14 -23
- data/lib/jira/resource/status.rb +7 -1
- data/lib/jira/resource/status_category.rb +10 -0
- data/lib/jira/resource/suggested_issue.rb +2 -0
- data/lib/jira/resource/transition.rb +2 -0
- data/lib/jira/resource/user.rb +3 -1
- data/lib/jira/resource/version.rb +2 -0
- data/lib/jira/resource/watcher.rb +3 -2
- data/lib/jira/resource/webhook.rb +9 -3
- data/lib/jira/resource/worklog.rb +15 -2
- data/lib/jira/version.rb +3 -1
- data/lib/jira-ruby.rb +6 -3
- data/lib/tasks/generate.rake +3 -1
- data/spec/data/files/jwt-signed-urls.json +317 -0
- data/spec/data/files/short.txt +1 -0
- data/spec/integration/attachment_spec.rb +3 -3
- data/spec/integration/comment_spec.rb +8 -8
- data/spec/integration/component_spec.rb +7 -7
- data/spec/integration/field_spec.rb +3 -3
- data/spec/integration/issue_spec.rb +21 -18
- data/spec/integration/issuelinktype_spec.rb +3 -3
- data/spec/integration/issuetype_spec.rb +3 -3
- data/spec/integration/priority_spec.rb +3 -3
- data/spec/integration/project_spec.rb +8 -8
- data/spec/integration/properties_spec.rb +45 -0
- data/spec/integration/rapidview_spec.rb +10 -10
- data/spec/integration/resolution_spec.rb +3 -3
- data/spec/integration/status_category_spec.rb +20 -0
- data/spec/integration/status_spec.rb +4 -8
- data/spec/integration/transition_spec.rb +5 -4
- data/spec/integration/user_spec.rb +34 -11
- data/spec/integration/version_spec.rb +7 -7
- data/spec/integration/watcher_spec.rb +21 -18
- data/spec/integration/webhook_spec.rb +35 -0
- data/spec/integration/worklog_spec.rb +8 -8
- data/spec/jira/atlassian/jwt_spec.rb +60 -0
- data/spec/jira/base_factory_spec.rb +13 -3
- data/spec/jira/base_spec.rb +135 -98
- data/spec/jira/client_spec.rb +72 -56
- data/spec/jira/has_many_proxy_spec.rb +3 -3
- data/spec/jira/http_client_spec.rb +94 -27
- data/spec/jira/http_error_spec.rb +2 -2
- data/spec/jira/oauth_client_spec.rb +14 -8
- data/spec/jira/request_client_spec.rb +4 -4
- data/spec/jira/resource/agile_spec.rb +32 -32
- data/spec/jira/resource/attachment_spec.rb +170 -57
- data/spec/jira/resource/board_spec.rb +24 -23
- data/spec/jira/resource/createmeta_spec.rb +48 -48
- data/spec/jira/resource/field_spec.rb +44 -27
- data/spec/jira/resource/filter_spec.rb +7 -6
- data/spec/jira/resource/issue_picker_suggestions_spec.rb +17 -17
- data/spec/jira/resource/issue_spec.rb +159 -93
- data/spec/jira/resource/jira_picker_suggestions_issue_spec.rb +3 -3
- data/spec/jira/resource/project_factory_spec.rb +3 -2
- data/spec/jira/resource/project_spec.rb +16 -16
- data/spec/jira/resource/sprint_spec.rb +88 -9
- data/spec/jira/resource/status_spec.rb +21 -0
- data/spec/jira/resource/user_factory_spec.rb +5 -5
- data/spec/jira/resource/worklog_spec.rb +4 -4
- data/spec/mock_responses/board/1_issues.json +2 -1
- data/spec/mock_responses/issue/10002/properties/foo.json +4 -0
- data/spec/mock_responses/issue/10002/properties/xyz.json +4 -0
- data/spec/mock_responses/issue/10002/properties/xyz.put.json +4 -0
- data/spec/mock_responses/issue/10002/properties.json +12 -0
- data/spec/mock_responses/issue.json +1 -0
- data/spec/mock_responses/rapidview/SAMPLEPROJECT.issues.full.json +2 -1
- data/spec/mock_responses/rapidview/SAMPLEPROJECT.issues.json +2 -1
- data/spec/mock_responses/sprint/1.json +13 -0
- data/spec/mock_responses/status/1.json +8 -1
- data/spec/mock_responses/status.json +40 -5
- data/spec/mock_responses/statuscategory/1.json +7 -0
- data/spec/mock_responses/statuscategory.json +30 -0
- data/spec/mock_responses/{user_username=admin.json → user_accountId=1234567890abcdef01234567.json} +2 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/support/clients_helper.rb +5 -7
- data/spec/support/mock_client.rb +9 -0
- data/spec/support/mock_response.rb +8 -0
- data/spec/support/shared_examples/integration.rb +51 -58
- metadata +45 -257
- data/.travis.yml +0 -9
- data/example.rb +0 -232
- data/http-basic-example.rb +0 -113
- data/lib/jira/resource/sprint_report.rb +0 -8
- data/lib/jira/tasks.rb +0 -0
- data/spec/integration/webhook.rb +0 -25
- data/spec/jira/jwt_uri_builder_spec.rb +0 -59
- data/spec/mock_responses/jira/rest/webhooks/1.0/webhook.json +0 -11
- data/spec/mock_responses/webhook/webhook.json +0 -11
- /data/spec/mock_responses/{jira/rest/webhooks/1.0/webhook → webhook}/2.json +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class IssuelinkFactory < JIRA::BaseFactory # :nodoc:
|
|
4
6
|
end
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
class Issue < JIRA::Base
|
|
9
|
+
# Because of circular dependency Issue->IssueLink->Issue
|
|
10
|
+
# we have to declare JIRA::Resource::Issue class.
|
|
11
|
+
end
|
|
9
12
|
|
|
10
13
|
class Issuelink < JIRA::Base
|
|
11
14
|
has_one :type, class: JIRA::Resource::Issuelinktype
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class ProjectFactory < JIRA::BaseFactory # :nodoc:
|
|
@@ -15,7 +17,7 @@ module JIRA
|
|
|
15
17
|
|
|
16
18
|
# Returns all the issues for this project
|
|
17
19
|
def issues(options = {})
|
|
18
|
-
search_url = client.options[:rest_base_path]
|
|
20
|
+
search_url = "#{client.options[:rest_base_path]}/search/jql"
|
|
19
21
|
query_params = { jql: "project=\"#{key}\"" }
|
|
20
22
|
query_params.update Base.query_params_for_search(options)
|
|
21
23
|
response = client.get(url_with_query_params(search_url, query_params))
|
|
@@ -26,7 +28,7 @@ module JIRA
|
|
|
26
28
|
end
|
|
27
29
|
|
|
28
30
|
def users(start_at: nil, max_results: nil)
|
|
29
|
-
users_url = client.options[:rest_base_path]
|
|
31
|
+
users_url = "#{client.options[:rest_base_path]}/user/assignable/search"
|
|
30
32
|
query_params = { project: key_value }
|
|
31
33
|
query_params['startAt'] = start_at if start_at
|
|
32
34
|
query_params['maxResults'] = max_results if max_results
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'active_support/inflector'
|
|
4
|
+
|
|
5
|
+
module JIRA
|
|
6
|
+
module Resource
|
|
7
|
+
class PropertiesFactory < JIRA::BaseFactory # :nodoc:
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class Properties < JIRA::Base
|
|
11
|
+
belongs_to :issue
|
|
12
|
+
|
|
13
|
+
def self.key_attribute
|
|
14
|
+
:key
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.all(client, options = {})
|
|
18
|
+
issue = options[:issue]
|
|
19
|
+
raise ArgumentError, 'parent issue is required' unless issue
|
|
20
|
+
|
|
21
|
+
response = client.get("#{issue.url}/#{endpoint_name}")
|
|
22
|
+
json = parse_json(response.body)
|
|
23
|
+
json[key_attribute.to_s.pluralize].map do |attrs|
|
|
24
|
+
## Net get the individual property
|
|
25
|
+
self_response = client.get(attrs['self'])
|
|
26
|
+
property = parse_json(self_response.body)
|
|
27
|
+
## Make sure to build the new resource via the issue.properties in order to support the has_many proxy
|
|
28
|
+
issue.properties.build(property)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
## Override save so we can handle the required attrs (and default 'value' when appropriate)
|
|
33
|
+
def save!(attrs = {}, path = nil)
|
|
34
|
+
if attrs.is_a?(Hash) && attrs.key?(self.class.key_attribute.to_s)
|
|
35
|
+
raise ArgumentError, "Use of 'value' is required when '#{self.class.key_attribute}' is provided" \
|
|
36
|
+
unless attrs.key?('value')
|
|
37
|
+
|
|
38
|
+
set_attrs(self.class.key_attribute.to_s => attrs[self.class.key_attribute.to_s])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
raise ArgumentError, "'key' is required on a new record" if new_record?
|
|
42
|
+
|
|
43
|
+
path ||= patched_url
|
|
44
|
+
## We can take either the 'value' element from the hash, OR use the entire attrs as the value
|
|
45
|
+
value = attrs.is_a?(Hash) && attrs.key?('value') ? attrs['value'] : attrs
|
|
46
|
+
value = '' if value.nil?
|
|
47
|
+
## Note: this API endpoint requires a non-empty JSON body for the value of the property
|
|
48
|
+
## Note2: this API endpoint does not return a body, so no need to call set_attrs_from_response
|
|
49
|
+
client.send(:put, path, value.to_json)
|
|
50
|
+
set_attrs({ 'value' => value }, false)
|
|
51
|
+
@expanded = false
|
|
52
|
+
true
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'cgi'
|
|
2
4
|
|
|
3
5
|
module JIRA
|
|
@@ -7,7 +9,7 @@ module JIRA
|
|
|
7
9
|
|
|
8
10
|
class RapidView < JIRA::Base
|
|
9
11
|
def self.all(client)
|
|
10
|
-
response = client.get(path_base(client)
|
|
12
|
+
response = client.get("#{path_base(client)}/rapidview")
|
|
11
13
|
json = parse_json(response.body)
|
|
12
14
|
json['views'].map do |view|
|
|
13
15
|
client.RapidView.build(view)
|
|
@@ -44,7 +46,7 @@ module JIRA
|
|
|
44
46
|
|
|
45
47
|
def sprints(options = {})
|
|
46
48
|
params = { includeHistoricSprints: options.fetch(:include_historic, false),
|
|
47
|
-
includeFutureSprints:
|
|
49
|
+
includeFutureSprints: options.fetch(:include_future, false) }
|
|
48
50
|
response = client.get(path_base(client) + "/sprintquery/#{id}?#{params.to_query}")
|
|
49
51
|
json = self.class.parse_json(response.body)
|
|
50
52
|
json['sprints'].map do |sprint|
|
|
@@ -56,7 +58,7 @@ module JIRA
|
|
|
56
58
|
private
|
|
57
59
|
|
|
58
60
|
def self.path_base(client)
|
|
59
|
-
client.options[:context_path]
|
|
61
|
+
"#{client.options[:context_path]}/rest/greenhopper/1.0"
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
def path_base(client)
|
data/lib/jira/resource/sprint.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class SprintFactory < JIRA::BaseFactory # :nodoc:
|
|
@@ -12,19 +14,20 @@ module JIRA
|
|
|
12
14
|
|
|
13
15
|
# get all issues of sprint
|
|
14
16
|
def issues(options = {})
|
|
15
|
-
jql =
|
|
17
|
+
jql = "sprint = #{id}"
|
|
16
18
|
jql += " and updated >= '#{options[:updated]}'" if options[:updated]
|
|
17
19
|
Issue.jql(client, jql)
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
def add_issue(issue)
|
|
21
|
-
|
|
22
|
-
response = client.post("#{agile_path}/issue", request_body)
|
|
23
|
-
true
|
|
23
|
+
add_issues([issue]).first
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def
|
|
27
|
-
|
|
26
|
+
def add_issues(issues)
|
|
27
|
+
issue_ids = issues.map(&:id)
|
|
28
|
+
request_body = { issues: issue_ids }.to_json
|
|
29
|
+
client.post("#{agile_path}/issue", request_body)
|
|
30
|
+
issues
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
def start_date
|
|
@@ -42,13 +45,14 @@ module JIRA
|
|
|
42
45
|
def get_sprint_details_attribute(attribute_name)
|
|
43
46
|
attribute = instance_variable_get("@#{attribute_name}")
|
|
44
47
|
return attribute if attribute
|
|
48
|
+
|
|
45
49
|
get_sprint_details
|
|
46
50
|
instance_variable_get("@#{attribute_name}")
|
|
47
51
|
end
|
|
48
52
|
|
|
49
53
|
def get_sprint_details
|
|
50
54
|
search_url =
|
|
51
|
-
"#{client.options[:site]}#{client.options[:client_path]}/rest/
|
|
55
|
+
"#{client.options[:site]}#{client.options[:client_path]}/rest/agile/1.0/sprint/#{id}"
|
|
52
56
|
begin
|
|
53
57
|
response = client.get(search_url)
|
|
54
58
|
rescue StandardError
|
|
@@ -56,22 +60,9 @@ module JIRA
|
|
|
56
60
|
end
|
|
57
61
|
json = self.class.parse_json(response.body)
|
|
58
62
|
|
|
59
|
-
@start_date =
|
|
60
|
-
@end_date =
|
|
61
|
-
@
|
|
62
|
-
@sprint_report = client.SprintReport.build(json['contents'])
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def rapidview_id
|
|
66
|
-
return @attrs['rapidview_id'] if @attrs['rapidview_id']
|
|
67
|
-
search_url = client.options[:site] + '/secure/GHGoToBoard.jspa?sprintId=' + id.to_s
|
|
68
|
-
begin
|
|
69
|
-
response = client.get(search_url)
|
|
70
|
-
rescue JIRA::HTTPError => error
|
|
71
|
-
return unless error.response.instance_of? Net::HTTPFound
|
|
72
|
-
rapid_view_match = /rapidView=(\d+)&/.match(error.response['location'])
|
|
73
|
-
@attrs['rapidview_id'] = rapid_view_match[1] unless rapid_view_match.nil?
|
|
74
|
-
end
|
|
63
|
+
@start_date = json['startDate'] && Date.parse(json['startDate'])
|
|
64
|
+
@end_date = json['endDate'] && Date.parse(json['endDate'])
|
|
65
|
+
@complete_date = json['completeDate'] && Date.parse(json['completeDate'])
|
|
75
66
|
end
|
|
76
67
|
|
|
77
68
|
def save(attrs = {}, _path = nil)
|
data/lib/jira/resource/status.rb
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'status_category'
|
|
4
|
+
|
|
1
5
|
module JIRA
|
|
2
6
|
module Resource
|
|
3
7
|
class StatusFactory < JIRA::BaseFactory # :nodoc:
|
|
4
8
|
end
|
|
5
9
|
|
|
6
|
-
class Status < JIRA::Base
|
|
10
|
+
class Status < JIRA::Base
|
|
11
|
+
has_one :status_category, class: JIRA::Resource::StatusCategory, attribute_key: 'statusCategory'
|
|
12
|
+
end
|
|
7
13
|
end
|
|
8
14
|
end
|
data/lib/jira/resource/user.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class UserFactory < JIRA::BaseFactory # :nodoc:
|
|
@@ -13,7 +15,7 @@ module JIRA
|
|
|
13
15
|
MAX_RESULTS = 1000
|
|
14
16
|
|
|
15
17
|
def self.singular_path(client, key, prefix = '/')
|
|
16
|
-
collection_path(client, prefix)
|
|
18
|
+
"#{collection_path(client, prefix)}?accountId=#{key}"
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
# Cannot retrieve more than 1,000 users through the api, please see: https://jira.atlassian.com/browse/JRASERVER-65089
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class WatcherFactory < JIRA::BaseFactory # :nodoc:
|
|
@@ -26,10 +28,9 @@ module JIRA
|
|
|
26
28
|
|
|
27
29
|
def save!(user_id, path = nil)
|
|
28
30
|
path ||= new_record? ? url : patched_url
|
|
29
|
-
|
|
31
|
+
client.post(path, user_id.to_json)
|
|
30
32
|
true
|
|
31
33
|
end
|
|
32
|
-
|
|
33
34
|
end
|
|
34
35
|
end
|
|
35
36
|
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class WebhookFactory < JIRA::BaseFactory # :nodoc:
|
|
4
6
|
end
|
|
5
7
|
|
|
6
8
|
class Webhook < JIRA::Base
|
|
7
|
-
REST_BASE_PATH = '/rest/webhooks/1.0'
|
|
9
|
+
REST_BASE_PATH = '/rest/webhooks/1.0'
|
|
8
10
|
|
|
9
11
|
def self.endpoint_name
|
|
10
12
|
'webhook'
|
|
@@ -14,15 +16,19 @@ module JIRA
|
|
|
14
16
|
client.options[:context_path] + REST_BASE_PATH
|
|
15
17
|
end
|
|
16
18
|
|
|
19
|
+
def self.singular_path(client, key, prefix = '/')
|
|
20
|
+
"#{full_url(client)}#{prefix}/#{endpoint_name}/#{key}"
|
|
21
|
+
end
|
|
22
|
+
|
|
17
23
|
def self.collection_path(client, prefix = '/')
|
|
18
|
-
full_url(client)
|
|
24
|
+
"#{full_url(client)}#{prefix}/#{endpoint_name}"
|
|
19
25
|
end
|
|
20
26
|
|
|
21
27
|
def self.all(client, options = {})
|
|
22
28
|
response = client.get(collection_path(client))
|
|
23
29
|
json = parse_json(response.body)
|
|
24
30
|
json.map do |attrs|
|
|
25
|
-
new(client, { attrs:
|
|
31
|
+
new(client, { attrs: }.merge(options))
|
|
26
32
|
end
|
|
27
33
|
end
|
|
28
34
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module JIRA
|
|
2
4
|
module Resource
|
|
3
5
|
class WorklogFactory < JIRA::BaseFactory # :nodoc:
|
|
@@ -5,10 +7,21 @@ module JIRA
|
|
|
5
7
|
|
|
6
8
|
class Worklog < JIRA::Base
|
|
7
9
|
has_one :author, class: JIRA::Resource::User
|
|
8
|
-
has_one :update_author, class: JIRA::Resource::User,
|
|
9
|
-
attribute_key: 'updateAuthor'
|
|
10
|
+
has_one :update_author, class: JIRA::Resource::User, attribute_key: 'updateAuthor'
|
|
10
11
|
belongs_to :issue
|
|
11
12
|
nested_collections true
|
|
13
|
+
|
|
14
|
+
def self.all(client, options = {})
|
|
15
|
+
issue = options[:issue]
|
|
16
|
+
raise ArgumentError, 'parent issue is required' unless issue
|
|
17
|
+
|
|
18
|
+
response = client.get("#{issue.url}/#{endpoint_name}")
|
|
19
|
+
json = parse_json(response.body)
|
|
20
|
+
json = json[endpoint_name.pluralize]
|
|
21
|
+
json.map do |attrs|
|
|
22
|
+
new(client, { attrs: }.merge(options))
|
|
23
|
+
end
|
|
24
|
+
end
|
|
12
25
|
end
|
|
13
26
|
end
|
|
14
27
|
end
|
data/lib/jira/version.rb
CHANGED
data/lib/jira-ruby.rb
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
$LOAD_PATH << __dir__
|
|
2
4
|
|
|
3
5
|
require 'active_support'
|
|
4
6
|
require 'active_support/inflector'
|
|
5
7
|
ActiveSupport::Inflector.inflections do |inflector|
|
|
6
|
-
inflector.singular
|
|
8
|
+
inflector.singular(/status$/, 'status')
|
|
7
9
|
end
|
|
8
10
|
|
|
9
11
|
require 'jira/base'
|
|
@@ -18,8 +20,10 @@ require 'jira/resource/component'
|
|
|
18
20
|
require 'jira/resource/issuetype'
|
|
19
21
|
require 'jira/resource/version'
|
|
20
22
|
require 'jira/resource/status'
|
|
23
|
+
require 'jira/resource/status_category'
|
|
21
24
|
require 'jira/resource/transition'
|
|
22
25
|
require 'jira/resource/project'
|
|
26
|
+
require 'jira/resource/properties'
|
|
23
27
|
require 'jira/resource/priority'
|
|
24
28
|
require 'jira/resource/comment'
|
|
25
29
|
require 'jira/resource/worklog'
|
|
@@ -31,12 +35,11 @@ require 'jira/resource/issue_picker_suggestions_issue'
|
|
|
31
35
|
require 'jira/resource/issue_picker_suggestions'
|
|
32
36
|
require 'jira/resource/remotelink'
|
|
33
37
|
require 'jira/resource/sprint'
|
|
34
|
-
require 'jira/resource/
|
|
38
|
+
require 'jira/resource/resolution'
|
|
35
39
|
require 'jira/resource/issue'
|
|
36
40
|
require 'jira/resource/filter'
|
|
37
41
|
require 'jira/resource/field'
|
|
38
42
|
require 'jira/resource/rapidview'
|
|
39
|
-
require 'jira/resource/resolution'
|
|
40
43
|
require 'jira/resource/serverinfo'
|
|
41
44
|
require 'jira/resource/createmeta'
|
|
42
45
|
require 'jira/resource/webhook'
|
data/lib/tasks/generate.rake
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'securerandom'
|
|
2
4
|
|
|
3
5
|
namespace :jira do
|
|
@@ -11,7 +13,7 @@ namespace :jira do
|
|
|
11
13
|
task :generate_public_cert do
|
|
12
14
|
puts "Executing 'openssl req -x509 -nodes -newkey rsa:1024 -sha1 -keyout rsakey.pem -out rsacert.pem'"
|
|
13
15
|
system('openssl req -x509 -subj "/C=US/ST=New York/L=New York/O=SUMO Heavy Industries/CN=www.sumoheavy.com" -nodes -newkey rsa:1024 -sha1 -keyout rsakey.pem -out rsacert.pem')
|
|
14
|
-
puts "Done. The RSA-SHA1 private keyfile is in the current directory:
|
|
16
|
+
puts "Done. The RSA-SHA1 private keyfile is in the current directory: 'rsakey.pem'."
|
|
15
17
|
puts 'You will need to copy the following certificate into your application link configuration in Jira:'
|
|
16
18
|
system('cat rsacert.pem')
|
|
17
19
|
end
|