Commit ecb8e946 authored by Brett Walker's avatar Brett Walker

Only query for necessary jira fields

parent 58e88479
...@@ -7,6 +7,9 @@ module Jira ...@@ -7,6 +7,9 @@ module Jira
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
PER_PAGE = 100 PER_PAGE = 100
DEFAULT_FIELDS = %w[assignee created creator id issuetype key
labels priority project reporter resolutiondate
status statuscategorychangeddate summary updated].join(',').freeze
def initialize(jira_service, params = {}) def initialize(jira_service, params = {})
super(jira_service, params) super(jira_service, params)
...@@ -22,7 +25,7 @@ module Jira ...@@ -22,7 +25,7 @@ module Jira
override :url override :url
def url def url
"#{base_api_url}/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&maxResults=#{per_page}&fields=*all" "#{base_api_url}/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&maxResults=#{per_page}&fields=#{DEFAULT_FIELDS}"
end end
override :build_service_response override :build_service_response
......
...@@ -103,6 +103,12 @@ RSpec.describe Jira::Requests::Issues::ListService do ...@@ -103,6 +103,12 @@ RSpec.describe Jira::Requests::Issues::ListService do
subject subject
end end
end end
it 'requests for default fields' do
expect(client).to receive(:get).with(include("fields=#{described_class::DEFAULT_FIELDS}")).and_return([])
subject
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment