Skip to content

Commit ad6bf9e

Browse files
committed
Add support for jql report filtering
1 parent eb5e8d6 commit ad6bf9e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bin/assertthat-bdd-report

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ OptionParser.new do |opt|
1313
opt.on('-n','--runName RUN_NAME', 'The name of the run - default \'Test run dd MMM yyyy HH:mm:ss\'') { |o| options[:runName] = o }
1414
opt.on('-f','--jsonReportFolder JSON_FOLDER_PATH', 'Json report folder - default ./reports') { |o| options[:mode] = o }
1515
opt.on('-i','--jsonReportIncludePattern INCLUDE_REGEX', 'Regex to search for cucumber reports - default .*.json') { |o| options[:jql] = o }
16+
opt.on('-j','--jql JQL_FILTER', 'Jql issues filter to update with results') { |o| options[:jql] = o }
1617
opt.on('-x','--proxy PROXY_URL', 'proxy url to connect to Jira') { |o| options[:proxy] = o }
1718
opt.on_tail('-h', '--help', 'Show help') do
1819
puts opt

lib/assertthat-bdd.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSER
4343
end
4444

4545
class Report
46-
def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, runName: 'Test run '+Time.now.strftime("%d %b %Y %H:%M:%S"), jsonReportFolder: './reports', jsonReportIncludePattern: '.*.json', jiraServerUrl: nil )
46+
def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, runName: 'Test run '+Time.now.strftime("%d %b %Y %H:%M:%S"), jsonReportFolder: './reports', jsonReportIncludePattern: '.*.json', jql: nil ,jiraServerUrl: nil )
4747
url = "https://bdd.assertthat.app/rest/api/1/project/" + projectId + "/report"
4848
url = jiraServerUrl+"/rest/assertthat/latest/project/"+projectId+"/client/report" unless jiraServerUrl.nil?
4949
files = Find.find(jsonReportFolder).grep(/#{jsonReportIncludePattern}/)
@@ -60,7 +60,7 @@ def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTT
6060
:multipart => true,
6161
:file => File.new(f, 'rb')
6262
},
63-
:headers => { :params =>{:runName => runName, :runId=> runId}}
63+
:headers => { :params =>{:runName => runName, :runId=> runId, :jql=> jql}}
6464
)
6565
begin
6666
response = request.execute

0 commit comments

Comments
 (0)