diff --git a/lib/jira/base_factory.rb b/lib/jira/base_factory.rb index 60f2858b..92d5e1ca 100644 --- a/lib/jira/base_factory.rb +++ b/lib/jira/base_factory.rb @@ -38,7 +38,8 @@ def self.delegate_to_target_class(*method_names) # The principle purpose of this class is to delegate methods to the corresponding # non-factory class and automatically prepend the client argument to the argument # list. - delegate_to_target_class :all, :find, :collection_path, :singular_path, :jql, :get_backlog_issues, :get_board_issues, :get_sprints, :get_sprint_issues, :get_projects, :get_projects_full + delegate_to_target_class :all, :find, :collection_path, :singular_path, :jql, :get_backlog_issues, +:get_board_issues, :get_sprints, :get_sprint_issues, :get_projects, :get_projects_full # This method needs special handling as it has a default argument value def build(attrs = {}) diff --git a/lib/jira/client.rb b/lib/jira/client.rb index 0a4c761f..7fc09c94 100644 --- a/lib/jira/client.rb +++ b/lib/jira/client.rb @@ -60,7 +60,8 @@ class Client # The configuration options for this client instance attr_reader :options - def_delegators :@request_client, :init_access_token, :set_access_token, :set_request_token, :request_token, :access_token, :authenticated? + def_delegators :@request_client, :init_access_token, :set_access_token, :set_request_token, :request_token, +:access_token, :authenticated? DEFINED_OPTIONS = [ :site, @@ -121,11 +122,14 @@ def initialize(options = {}) raise ArgumentError, "Unknown option(s) given: #{unknown_options}" unless unknown_options.empty? if options[:use_client_cert] - @options[:ssl_client_cert] = OpenSSL::X509::Certificate.new(File.read(@options[:cert_path])) if @options[:cert_path] + @options[:ssl_client_cert] = +OpenSSL::X509::Certificate.new(File.read(@options[:cert_path])) if @options[:cert_path] @options[:ssl_client_key] = OpenSSL::PKey::RSA.new(File.read(@options[:key_path])) if @options[:key_path] - raise ArgumentError, 'Options: :cert_path or :ssl_client_cert must be set when :use_client_cert is true' unless @options[:ssl_client_cert] - raise ArgumentError, 'Options: :key_path or :ssl_client_key must be set when :use_client_cert is true' unless @options[:ssl_client_key] + raise ArgumentError, +'Options: :cert_path or :ssl_client_cert must be set when :use_client_cert is true' unless @options[:ssl_client_cert] + raise ArgumentError, +'Options: :key_path or :ssl_client_key must be set when :use_client_cert is true' unless @options[:ssl_client_key] end case options[:auth_type] @@ -137,7 +141,8 @@ def initialize(options = {}) when :basic @request_client = HttpClient.new(@options) when :cookie - raise ArgumentError, 'Options: :use_cookies must be true for :cookie authorization type' if @options.key?(:use_cookies) && !@options[:use_cookies] + raise ArgumentError, +'Options: :use_cookies must be true for :cookie authorization type' if @options.key?(:use_cookies) && !@options[:use_cookies] @options[:use_cookies] = true @request_client = HttpClient.new(@options) diff --git a/lib/jira/http_client.rb b/lib/jira/http_client.rb index 5c16d8f8..ce88ce4c 100644 --- a/lib/jira/http_client.rb +++ b/lib/jira/http_client.rb @@ -49,7 +49,8 @@ def basic_auth_http_conn def http_conn(uri) http_conn = if @options[:proxy_address] - Net::HTTP.new(uri.host, uri.port, @options[:proxy_address], @options[:proxy_port] || 80, @options[:proxy_username], @options[:proxy_password]) + Net::HTTP.new(uri.host, uri.port, @options[:proxy_address], @options[:proxy_port] || 80, +@options[:proxy_username], @options[:proxy_password]) else Net::HTTP.new(uri.host, uri.port) end diff --git a/lib/jira/resource/issue.rb b/lib/jira/resource/issue.rb index 32d7141e..efca5bce 100644 --- a/lib/jira/resource/issue.rb +++ b/lib/jira/resource/issue.rb @@ -48,10 +48,12 @@ def self.all(client) result end - def self.jql(client, jql, options = { fields: nil, start_at: nil, max_results: nil, expand: nil, validate_query: true }) + def self.jql(client, jql, options = { fields: nil, start_at: nil, max_results: nil, expand: nil, +validate_query: true }) url = client.options[:rest_base_path] + "/search?jql=#{CGI.escape(jql)}" - url << "&fields=#{options[:fields].map { |value| CGI.escape(client.Field.name_to_id(value)) }.join(',')}" if options[:fields] + url << "&fields=#{options[:fields].map { |value| + CGI.escape(client.Field.name_to_id(value)) }.join(',')}" if options[:fields] url << "&startAt=#{CGI.escape(options[:start_at].to_s)}" if options[:start_at] url << "&maxResults=#{CGI.escape(options[:max_results].to_s)}" if options[:max_results] url << '&validateQuery=false' if options[:validate_query] === false @@ -97,7 +99,8 @@ def editmeta end def respond_to?(method_name, _include_all = false) - if attrs.key?('fields') && [method_name.to_s, client.Field.name_to_id(method_name)].any? { |k| attrs['fields'].key?(k) } + if attrs.key?('fields') && [method_name.to_s, client.Field.name_to_id(method_name)].any? { |k| + attrs['fields'].key?(k) } true else super(method_name) diff --git a/lib/jira/resource/issue_picker_suggestions.rb b/lib/jira/resource/issue_picker_suggestions.rb index 7fd48a06..6a31e454 100644 --- a/lib/jira/resource/issue_picker_suggestions.rb +++ b/lib/jira/resource/issue_picker_suggestions.rb @@ -8,7 +8,8 @@ class IssuePickerSuggestionsFactory < JIRA::BaseFactory # :nodoc: class IssuePickerSuggestions < JIRA::Base has_many :sections, class: JIRA::Resource::IssuePickerSuggestionsIssue - def self.all(client, query = '', options = { current_jql: nil, current_issue_key: nil, current_project_id: nil, show_sub_tasks: nil, show_sub_tasks_parent: nil }) + def self.all(client, query = '', options = { current_jql: nil, current_issue_key: nil, current_project_id: nil, +show_sub_tasks: nil, show_sub_tasks_parent: nil }) url = client.options[:rest_base_path] + "/issue/picker?query=#{CGI.escape(query)}" url << "¤tJQL=#{CGI.escape(options[:current_jql])}" if options[:current_jql] diff --git a/spec/integration/webhook.rb b/spec/integration/webhook.rb index 2c53278b..f1ae6d98 100644 --- a/spec/integration/webhook.rb +++ b/spec/integration/webhook.rb @@ -8,7 +8,8 @@ let(:key) { '2' } let(:expected_attributes) do - { 'name' => 'from API', 'url' => 'http://localhost:3000/webhooks/1', 'excludeBody' => false, 'filters' => { 'issue-related-events-section' => '' }, 'events' => [], 'enabled' => true, 'self' => 'http://localhost:2990/jira/rest/webhooks/1.0/webhook/2', 'lastUpdatedUser' => 'admin', 'lastUpdatedDisplayName' => 'admin', 'lastUpdated' => 1_453_306_520_188 } + { 'name' => 'from API', 'url' => 'http://localhost:3000/webhooks/1', 'excludeBody' => false, +'filters' => { 'issue-related-events-section' => '' }, 'events' => [], 'enabled' => true, 'self' => 'http://localhost:2990/jira/rest/webhooks/1.0/webhook/2', 'lastUpdatedUser' => 'admin', 'lastUpdatedDisplayName' => 'admin', 'lastUpdated' => 1_453_306_520_188 } end let(:expected_collection_length) { 1 } diff --git a/spec/jira/base_spec.rb b/spec/jira/base_spec.rb index 0833a940..8e4ddb98 100644 --- a/spec/jira/base_spec.rb +++ b/spec/jira/base_spec.rb @@ -258,7 +258,8 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc: it 'returns false when an invalid field is set' do # The JIRA REST API apparently ignores fields that you aren't allowed to set manually response = instance_double('Response', body: '{"errorMessages":["blah"]}', status: 400) allow(subject).to receive(:new_record?) { false } - expect(client).to receive(:put).with('/foo/bar', '{"invalid_field":"foobar"}').and_raise(JIRA::HTTPError.new(response)) + expect(client).to receive(:put).with('/foo/bar', +'{"invalid_field":"foobar"}').and_raise(JIRA::HTTPError.new(response)) expect(subject.save('invalid_field' => 'foobar')).to be_falsey end @@ -300,7 +301,8 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc: it 'throws an exception when an invalid field is set' do response = instance_double('Response', body: '{"errorMessages":["blah"]}', status: 400) allow(subject).to receive(:new_record?) { false } - expect(client).to receive(:put).with('/foo/bar', '{"invalid_field":"foobar"}').and_raise(JIRA::HTTPError.new(response)) + expect(client).to receive(:put).with('/foo/bar', +'{"invalid_field":"foobar"}').and_raise(JIRA::HTTPError.new(response)) expect{ subject.save!('invalid_field' => 'foobar') }.to raise_error(JIRA::HTTPError) end end @@ -487,7 +489,8 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc: end it 'allows the has_many attributes to be nested inside another attribute' do - subject = JIRA::Resource::HasManyExample.new(client, attrs: { 'nested' => { 'brunchmuffins' => [{ 'id' => '123' }, { 'id' => '456' }] } }) + subject = JIRA::Resource::HasManyExample.new(client, +attrs: { 'nested' => { 'brunchmuffins' => [{ 'id' => '123' }, { 'id' => '456' }] } }) expect(subject.brunchmuffins.length).to eq(2) subject.brunchmuffins.each do |brunchmuffin| expect(brunchmuffin.class).to eq(JIRA::Resource::Deadbeef) @@ -512,7 +515,8 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc: end it 'allows the attribute key to be specified' do - subject = JIRA::Resource::HasManyExample.new(client, attrs: { 'irregularlyNamedThings' => [{ 'id' => '123' }, { 'id' => '456' }] }) + subject = JIRA::Resource::HasManyExample.new(client, +attrs: { 'irregularlyNamedThings' => [{ 'id' => '123' }, { 'id' => '456' }] }) expect(subject.irregularly_named_things.length).to eq(2) subject.irregularly_named_things.each do |thing| expect(thing.class).to eq(JIRA::Resource::Deadbeef) @@ -545,7 +549,8 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc: end it 'allows the has_one attributes to be nested inside another attribute' do - subject = JIRA::Resource::HasOneExample.new(client, attrs: { 'nested' => { 'brunchmuffin' => { 'id' => '123' } } }) + subject = JIRA::Resource::HasOneExample.new(client, +attrs: { 'nested' => { 'brunchmuffin' => { 'id' => '123' } } }) expect(subject.brunchmuffin.class).to eq(JIRA::Resource::Deadbeef) expect(subject.brunchmuffin.id).to eq('123') end diff --git a/spec/jira/client_spec.rb b/spec/jira/client_spec.rb index e1b3f5ca..25642e86 100644 --- a/spec/jira/client_spec.rb +++ b/spec/jira/client_spec.rb @@ -66,9 +66,13 @@ subject { JIRA::Client.new(options) } it 'raises an ArgumentError' do - expect { subject }.to raise_exception(ArgumentError, 'Options: :cert_path or :ssl_client_cert must be set when :use_client_cert is true') + expect { + subject }.to raise_exception(ArgumentError, +'Options: :cert_path or :ssl_client_cert must be set when :use_client_cert is true') options[:ssl_client_cert] = '' - expect { subject }.to raise_exception(ArgumentError, 'Options: :key_path or :ssl_client_key must be set when :use_client_cert is true') + expect { + subject }.to raise_exception(ArgumentError, +'Options: :key_path or :ssl_client_key must be set when :use_client_cert is true') end end end @@ -77,11 +81,13 @@ RSpec.shared_examples 'HttpClient tests' do it 'makes a valid request' do %i[delete get head].each do |method| - expect(subject.request_client).to receive(:make_request).with(method, '/path', nil, headers).and_return(successful_response) + expect(subject.request_client).to receive(:make_request).with(method, '/path', nil, +headers).and_return(successful_response) subject.send(method, '/path', headers) end %i[post put].each do |method| - expect(subject.request_client).to receive(:make_request).with(method, '/path', '', merged_headers).and_return(successful_response) + expect(subject.request_client).to receive(:make_request).with(method, '/path', '', +merged_headers).and_return(successful_response) subject.send(method, '/path', '', headers) end end @@ -106,11 +112,13 @@ describe 'that call a oauth client' do specify 'which makes a request' do %i[delete get head].each do |method| - expect(subject.request_client).to receive(:make_request).with(method, '/path', nil, headers).and_return(successful_response) + expect(subject.request_client).to receive(:make_request).with(method, '/path', nil, +headers).and_return(successful_response) subject.send(method, '/path', {}) end %i[post put].each do |method| - expect(subject.request_client).to receive(:make_request).with(method, '/path', '', merged_headers).and_return(successful_response) + expect(subject.request_client).to receive(:make_request).with(method, '/path', '', +merged_headers).and_return(successful_response) subject.send(method, '/path', '', {}) end end diff --git a/spec/jira/http_client_spec.rb b/spec/jira/http_client_spec.rb index 9a0a96da..436b5e9a 100644 --- a/spec/jira/http_client_spec.rb +++ b/spec/jira/http_client_spec.rb @@ -149,7 +149,8 @@ basic_auth_http_conn = double request = double allow(basic_client).to receive(:basic_auth_http_conn).and_return(basic_auth_http_conn) - expect(request).to receive(:basic_auth).with(basic_client.options[:username], basic_client.options[:password]).exactly(5).times.and_return(request) + expect(request).to receive(:basic_auth).with(basic_client.options[:username], +basic_client.options[:password]).exactly(5).times.and_return(request) expect(basic_auth_http_conn).to receive(:request).exactly(5).times.with(request).and_return(response) %i[delete get head].each do |method| expect(Net::HTTP.const_get(method.to_s.capitalize)).to receive(:new).with('/path', headers).and_return(request) @@ -168,7 +169,8 @@ basic_auth_http_conn = double request = double allow(basic_cookie_client).to receive(:basic_auth_http_conn).and_return(basic_auth_http_conn) - expect(request).to receive(:basic_auth).with(basic_cookie_client.options[:username], basic_cookie_client.options[:password]).exactly(5).times.and_return(request) + expect(request).to receive(:basic_auth).with(basic_cookie_client.options[:username], +basic_cookie_client.options[:password]).exactly(5).times.and_return(request) expect(cookie_response).to receive(:get_fields).with('set-cookie').exactly(5).times expect(basic_auth_http_conn).to receive(:request).exactly(5).times.with(request).and_return(cookie_response) %i[delete get head].each do |method| @@ -189,7 +191,8 @@ basic_auth_http_conn = double request = double allow(client).to receive(:basic_auth_http_conn).and_return(basic_auth_http_conn) - expect(request).to receive(:basic_auth).with(client.options[:username], client.options[:password]).exactly(5).times.and_return(request) + expect(request).to receive(:basic_auth).with(client.options[:username], +client.options[:password]).exactly(5).times.and_return(request) expect(request).to receive(:add_field).with('Cookie', 'sessionToken=abc123; internal=true').exactly(5).times expect(cookie_response).to receive(:get_fields).with('set-cookie').exactly(5).times expect(basic_auth_http_conn).to receive(:request).exactly(5).times.with(request).and_return(cookie_response) @@ -212,7 +215,8 @@ expect(Net::HTTP::Get).to receive(:new).with('/foo', headers).and_return(http_request) expect(basic_auth_http_conn).to receive(:request).with(http_request).and_return(response) - expect(http_request).to receive(:basic_auth).with(basic_client.options[:username], basic_client.options[:password]).and_return(http_request) + expect(http_request).to receive(:basic_auth).with(basic_client.options[:username], +basic_client.options[:password]).and_return(http_request) allow(basic_client).to receive(:basic_auth_http_conn).and_return(basic_auth_http_conn) basic_client.make_request(:get, '/foo', body, headers) end @@ -225,7 +229,8 @@ expect(Net::HTTP::Get).to receive(:new).with('/foo', headers).and_return(http_request) expect(basic_auth_http_conn).to receive(:request).with(http_request).and_return(response) - expect(http_request).to receive(:basic_auth).with(basic_client.options[:username], basic_client.options[:password]).and_return(http_request) + expect(http_request).to receive(:basic_auth).with(basic_client.options[:username], +basic_client.options[:password]).and_return(http_request) allow(basic_client).to receive(:basic_auth_http_conn).and_return(basic_auth_http_conn) basic_client.make_request(:get, 'http://mydomain.com/foo', body, headers) end @@ -381,7 +386,8 @@ end it 'performs a basic http client request' do - expect(request).to receive(:basic_auth).with(basic_client.options[:username], basic_client.options[:password]).and_return(request) + expect(request).to receive(:basic_auth).with(basic_client.options[:username], +basic_client.options[:password]).and_return(request) subject end diff --git a/spec/jira/oauth_client_spec.rb b/spec/jira/oauth_client_spec.rb index 165443e8..5f665c59 100644 --- a/spec/jira/oauth_client_spec.rb +++ b/spec/jira/oauth_client_spec.rb @@ -136,7 +136,8 @@ it 'signs the access_token and performs the request' do expect(access_token).to receive(:sign!).with(an_instance_of(Net::HTTP::Post::Multipart)) - expect(oauth_client.consumer).to receive_message_chain(:http, :request).with(an_instance_of(Net::HTTP::Post::Multipart)) + expect(oauth_client.consumer).to receive_message_chain(:http, +:request).with(an_instance_of(Net::HTTP::Post::Multipart)) subject end @@ -169,11 +170,13 @@ mock_access_token = double allow(oauth__2legged_client).to receive(:access_token).and_return(mock_access_token) %i[delete get head].each do |method| - expect(mock_access_token).to receive(method).with('/path?any_param=toto&oauth_token=', headers).and_return(response) + expect(mock_access_token).to receive(method).with('/path?any_param=toto&oauth_token=', +headers).and_return(response) oauth__2legged_client.make_request(method, '/path?any_param=toto', '', headers) end %i[post put].each do |method| - expect(mock_access_token).to receive(method).with('/path?any_param=toto&oauth_token=', '', headers).and_return(response) + expect(mock_access_token).to receive(method).with('/path?any_param=toto&oauth_token=', '', +headers).and_return(response) oauth__2legged_client.make_request(method, '/path?any_param=toto', '', headers) end end diff --git a/spec/jira/resource/attachment_spec.rb b/spec/jira/resource/attachment_spec.rb index 8d377d5a..8fa30547 100644 --- a/spec/jira/resource/attachment_spec.rb +++ b/spec/jira/resource/attachment_spec.rb @@ -139,7 +139,8 @@ attrs: { 'author' => { 'foo' => 'bar' } } ) end - let(:default_headers_given) { { 'authorization' => 'Bearer 83CF8B609DE60036A8277BD0E96135751BBC07EB234256D4B65B893360651BF2' } } + let(:default_headers_given) { + { 'authorization' => 'Bearer 83CF8B609DE60036A8277BD0E96135751BBC07EB234256D4B65B893360651BF2' } } let(:bearer_client) do JIRA::Client.new(username: 'username', password: 'password', auth_type: :basic, use_ssl: false, default_headers: default_headers_given ) @@ -149,7 +150,8 @@ end it 'passes the custom headers' do - expect(bearer_client.request_client).to receive(:request_multipart).with(anything, anything, merged_headers).and_return(response) + expect(bearer_client.request_client).to receive(:request_multipart).with(anything, anything, +merged_headers).and_return(response) bearer_attachment.save('file' => path_to_file) @@ -193,7 +195,8 @@ attrs: { 'author' => { 'foo' => 'bar' } } ) end - let(:default_headers_given) { { 'authorization' => 'Bearer 83CF8B609DE60036A8277BD0E96135751BBC07EB234256D4B65B893360651BF2' } } + let(:default_headers_given) { + { 'authorization' => 'Bearer 83CF8B609DE60036A8277BD0E96135751BBC07EB234256D4B65B893360651BF2' } } let(:bearer_client) do JIRA::Client.new(username: 'username', password: 'password', auth_type: :basic, use_ssl: false, default_headers: default_headers_given ) @@ -203,7 +206,8 @@ end it 'passes the custom headers' do - expect(bearer_client.request_client).to receive(:request_multipart).with(anything, anything, merged_headers).and_return(response) + expect(bearer_client.request_client).to receive(:request_multipart).with(anything, anything, +merged_headers).and_return(response) bearer_attachment.save!('file' => path_to_file) diff --git a/spec/jira/resource/field_spec.rb b/spec/jira/resource/field_spec.rb index eb4aadcd..355cfcd6 100644 --- a/spec/jira/resource/field_spec.rb +++ b/spec/jira/resource/field_spec.rb @@ -10,15 +10,33 @@ allow(client).to receive(:cache).and_return(cache) # info about all fields on the client allow(client.Field).to receive(:all).and_return([ - JIRA::Resource::Field.new(client, attrs: { 'id' => 'customfield_10666', 'name' => 'Priority', 'custom' => true, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10666]', 'Priority'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_666 } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'issuekey', 'name' => 'Key', 'custom' => false, 'orderable' => false, 'navigable' => true, 'searchable' => false, 'clauseNames' => %w[id issue issuekey key] }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'priority', 'name' => 'Priority', 'custom' => false, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['priority'], 'schema' => { 'type' => 'priority', 'system' => 'priority' } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'summary', 'name' => 'Summary', 'custom' => false, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['summary'], 'schema' => { 'type' => 'string', 'system' => 'summary' } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'issuetype', 'name' => 'Issue Type', 'custom' => false, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => %w[issuetype type], 'schema' => { 'type' => 'issuetype', 'system' => 'issuetype' } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'customfield_10111', 'name' => 'SingleWord', 'custom' => true, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10111]', 'SingleWord'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_111 } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'customfield_10222', 'name' => 'Multi Word', 'custom' => true, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10222]', 'Multi Word'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_222 } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'customfield_10333', 'name' => 'Why/N@t', 'custom' => true, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10333]', 'Why/N@t'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_333 } }), - JIRA::Resource::Field.new(client, attrs: { 'id' => 'customfield_10444', 'name' => 'SingleWord', 'custom' => true, 'orderable' => true, 'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10444]', 'SingleWord'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_444 } }) + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'customfield_10666', 'name' => 'Priority', 'custom' => true, 'orderable' => true, 'navigable' => true, +'searchable' => true, 'clauseNames' => ['cf[10666]', 'Priority'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_666 } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'issuekey', 'name' => 'Key', 'custom' => false, 'orderable' => false, +'navigable' => true, 'searchable' => false, 'clauseNames' => %w[id issue issuekey key] }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'priority', 'name' => 'Priority', 'custom' => false, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => ['priority'], 'schema' => { 'type' => 'priority', 'system' => 'priority' } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'summary', 'name' => 'Summary', 'custom' => false, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => ['summary'], 'schema' => { 'type' => 'string', 'system' => 'summary' } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'issuetype', 'name' => 'Issue Type', 'custom' => false, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => %w[issuetype type], 'schema' => { 'type' => 'issuetype', 'system' => 'issuetype' } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'customfield_10111', 'name' => 'SingleWord', 'custom' => true, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10111]', 'SingleWord'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_111 } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'customfield_10222', 'name' => 'Multi Word', 'custom' => true, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10222]', 'Multi Word'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_222 } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'customfield_10333', 'name' => 'Why/N@t', 'custom' => true, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10333]', 'Why/N@t'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_333 } }), + JIRA::Resource::Field.new(client, +attrs: { 'id' => 'customfield_10444', 'name' => 'SingleWord', 'custom' => true, 'orderable' => true, +'navigable' => true, 'searchable' => true, 'clauseNames' => ['cf[10444]', 'SingleWord'], 'schema' => { 'type' => 'string', 'custom' => 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'customId' => 10_444 } }) ]) client end