fastlane-plugin-jira_release_notes 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d26d8c9a36e9fc6464778b2ae1284f25661b50b8ee2cd7a65266a56307038f7e
4
- data.tar.gz: 52b9101f537ceb31e6de5d29fda379822e261725dd8745036a8f1e982c918b3f
3
+ metadata.gz: a809ab8371eb9491ff22d435568c75897ebd7faa6f642701b54abf6cb11941c1
4
+ data.tar.gz: 14074a19d6dfbca5bee60c60d079cd8e72384f24a58241f31d7f3136de8d5c1a
5
5
  SHA512:
6
- metadata.gz: 344a6ddc7bf2e9d4014b0a08526edde8856709b6ab16c36bfdd67b6e2d97fcd669579a849ab4908513181978fad6d7e4dfb1db0b7cc36c7d9f22d938d3cf7d7d
7
- data.tar.gz: 717a599f65dd3be2792c97a40766466f5263e8c6ba43516928e1dad63fce9280deb6b4727fa319d2ecd5a2694372e890444f6bc6f72f0cee9ea543a7124a459d
6
+ metadata.gz: ca088ca052af31fb6104ce9c3ef82c4298f24a38f12043f627fffa28afe0bb77034380592d1ae72a7f19d429ebaf935cdab3b9fd1cd140f9540f76eac6a4203e
7
+ data.tar.gz: b8d57286daf72ae2283145bb60cb2575f107fc78c75c4a3316d496cf6dd1dd74d17b503a13b15d146c161892c5209704fa6184d995fc5be5b602b18095136a52
data/README.md CHANGED
@@ -19,6 +19,20 @@ Release notes from JIRA for version
19
19
 
20
20
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
21
21
 
22
+ ```ruby
23
+ lane :notes do
24
+ text = jira_release_notes(
25
+ username: "me",
26
+ password: "123", # password or api token
27
+ url: "https://jira.example.com",
28
+ project: "OX",
29
+ version: "0.1",
30
+ status: "Testable",
31
+ format: "plain"
32
+ )
33
+ puts text
34
+ end
35
+ ```
22
36
 
23
37
  ## Options
24
38
 
@@ -35,6 +49,7 @@ username | Username for Jira instance | FL_JIRA_USERNAME |
35
49
  password | Password for Jira or api token | FL_JIRA_PASSWORD |
36
50
  project | Jira project name | FL_JIRA_PROJECT |
37
51
  version | Jira project version | FL_JIRA_PROJECT_VERSION |
52
+ status | Jira issue status | FL_JIRA_STATUS |
38
53
  format | Format text. Plain, html or none | FL_JIRA_RELEASE_NOTES_FORMAT | plain
39
54
  max_results | Maximum number of issues | FL_JIRA_RELEASE_NOTES_MAX_RESULTS | 50
40
55
 
@@ -15,6 +15,7 @@ module Fastlane
15
15
 
16
16
  version = params[:version]
17
17
  project = params[:project]
18
+ status = params[:status]
18
19
  max_results = params[:max_results].to_i
19
20
  issues = []
20
21
 
@@ -25,19 +26,22 @@ module Fastlane
25
26
  versions = client.Project.find(project).versions
26
27
  .select { |v| version.match(v.name) }
27
28
  .map { |v| "'#{v.name}'" } .join(', ')
28
- issues = client.Issue.jql("PROJECT = '#{project}' AND fixVersion in (#{versions})",
29
- max_results: max_results)
29
+ jql = "PROJECT = '#{project}' AND fixVersion in (#{versions})"
30
30
  else
31
- issues = client.Issue.jql("PROJECT = '#{project}' AND fixVersion = '#{version}'",
32
- max_results: max_results)
31
+ jql = "PROJECT = '#{project}' AND fixVersion = '#{version}'"
33
32
  end
33
+ unless status.nil? or status.empty?
34
+ jql += " AND status = '#{status}'"
35
+ end
36
+ issues = client.Issue.jql(jql,max_results: max_results)
37
+
34
38
  rescue JIRA::HTTPError => e
35
39
  fields = [e.code, e.message]
36
40
  fields << e.response.body if e.response.content_type == "application/json"
37
41
  UI.user_error!("#{e} #{fields.join(', ')}")
38
42
  end
39
43
 
40
- UI.success("📝 #{issues.count} issues from JIRA project '#{project}', version '#{version}'")
44
+ UI.success("📝 #{issues.count} issues from JIRA project '#{project}', version '#{version}', status '#{status}'")
41
45
 
42
46
  case params[:format]
43
47
  when "plain"
@@ -93,6 +97,11 @@ module Fastlane
93
97
  verify_block: proc do |value|
94
98
  UI.user_error!("No Jira project name") if value.to_s.length == 0
95
99
  end),
100
+ FastlaneCore::ConfigItem.new(key: :status,
101
+ env_name: "FL_JIRA_STATUS",
102
+ description: "Jira issue status",
103
+ sensitive: true,
104
+ default_value: ""),
96
105
  FastlaneCore::ConfigItem.new(key: :version,
97
106
  env_name: "FL_JIRA_PROJECT_VERSION",
98
107
  description: "Jira project version",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module JiraReleaseNotes
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-jira_release_notes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Ignition
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-22 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jira-ruby
@@ -153,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  requirements: []
156
- rubyforge_project:
157
- rubygems_version: 2.7.7
156
+ rubygems_version: 3.0.3
158
157
  signing_key:
159
158
  specification_version: 4
160
159
  summary: Release notes from JIRA for version