fastlane-plugin-jira_fetch_tickets 0.1.1 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36c47590076e0bc1642714f517cf98d7993bffecda6f77d0151281382e81e778
4
- data.tar.gz: 97a25af86199612808a8800baf81ae500d243a6b011d7dd8ff9aaad88dd14eae
3
+ metadata.gz: 88f6eca696eedd7b7a2b16a7a9aff13cf0b91e350b37ff09adcdcc2dd2881b59
4
+ data.tar.gz: 767c820b0c14277332988d719dcba5c36b434f21168fd98e8d7270cb079767be
5
5
  SHA512:
6
- metadata.gz: 20e181d913a7f435f879ad42a9df3e9bb0071ed486b406f3c30216eaf34d0d55d09a74a8c1fc6de05b91cbd0e3da4fa719f7d2dacaf83931ae138465e85a3a91
7
- data.tar.gz: 4f2120e8050d342e5495a73d511c41d036dd39698fafb751ed182a9099de16436662cea0b16544539c03ec5edf709fe1531da35fb97bcc79d346c01d02800990
6
+ metadata.gz: 7805cce4b4dc152ebd2d3fad44d93c719f8d8a8313b9865efc40f67a1e8d0adef99dc28cd4adffd65c71e87812ab992bbd07c1ae142dac18233fbaaf948d2d07
7
+ data.tar.gz: b0331ad9f7ebadb41b0f9f7465434e8b967f4e3c8b2b64c0ba37cbd8f55d24c3de8a6048dfb40e75fbad2ec8a63cb9b9c14457d150d5db4b4328f4c68dd6dc3a
@@ -33,6 +33,8 @@ module Fastlane
33
33
  label = params[:label]
34
34
  sprints = params[:sprints]
35
35
  sprint = params[:sprint]
36
+ fix_versions = params[:fix_versions]
37
+ fix_version = params[:fix_version]
36
38
  custom_jql = params[:custom_jql]
37
39
 
38
40
  jql = ''
@@ -83,6 +85,18 @@ module Fastlane
83
85
  jql = append_jql_from_string?(options)
84
86
  end
85
87
 
88
+ added = false
89
+ unless fix_versions.instance_of?(NilClass)
90
+ options = { key: 'fixversion', values: fix_versions, jql: jql }
91
+ jql = append_jql_from_array?(options)
92
+ added = true
93
+ end
94
+
95
+ if !added && !fix_version.instance_of?(NilClass)
96
+ options = { key: 'fixversion', value: fix_version, jql: jql }
97
+ jql = append_jql_from_string?(options)
98
+ end
99
+
86
100
  if custom_jql
87
101
  options = { jql: jql, new_value: custom_jql }
88
102
  jql = append_jql?(options)
@@ -105,7 +119,7 @@ module Fastlane
105
119
  def self.jql_from_array?(options)
106
120
  values = options[:values]
107
121
  values = values.map do |string|
108
- if string.include?(' ')
122
+ if string.should_escape
109
123
  "\"#{string}\""
110
124
  else
111
125
  string.to_s
@@ -124,7 +138,7 @@ module Fastlane
124
138
 
125
139
  def self.jql_from_string?(options)
126
140
  value = options[:value]
127
- if value.include?(' ')
141
+ if value.should_escape
128
142
  "#{options[:key]} = \"#{options[:value]}\""
129
143
  else
130
144
  "#{options[:key]} = #{options[:value]}"
@@ -252,6 +266,20 @@ module Fastlane
252
266
  conflict_block: proc do |_other|
253
267
  FastlaneCore::UI.message('Ignoring :sprint in favor of :sprints')
254
268
  end),
269
+ FastlaneCore::ConfigItem.new(key: :fix_versions,
270
+ env_name: 'FL_JIRA_FETCH_JQL_FIX_VERSIONS',
271
+ description: 'Jira fix versions',
272
+ type: Array,
273
+ optional: true),
274
+ FastlaneCore::ConfigItem.new(key: :fix_version,
275
+ env_name: 'FL_JIRA_FETCH_JQL_FIX_VERSION',
276
+ description: 'Jira fix version',
277
+ type: String,
278
+ optional: true,
279
+ conflicting_options: [:fix_versions],
280
+ conflict_block: proc do |_other|
281
+ FastlaneCore::UI.message('Ignoring :fix_version in favor of :fix_versions')
282
+ end),
255
283
  FastlaneCore::ConfigItem.new(key: :custom_jql,
256
284
  env_name: 'FL_JIRA_FETCH_JQL_CUSTOM',
257
285
  description: 'Jira custom jql',
@@ -288,3 +316,9 @@ module Fastlane
288
316
  end
289
317
  end
290
318
  end
319
+
320
+ class String
321
+ def should_escape
322
+ include?(' ') || include?('(') || include?(')')
323
+ end
324
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module JiraFetchTickets
5
- VERSION = '0.1.1'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-jira_fetch_tickets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Tagliabue