Class: Pipeline::JiraOneTimeFilter

Inherits:
BaseFilter show all
Defined in:
lib/pipeline/filters/jira_one_time_filter.rb

Instance Attribute Summary

Attributes inherited from BaseFilter

#description, #name

Instance Method Summary collapse

Constructor Details

#initializeJiraOneTimeFilter

Pipeline::Filters.add self



9
10
11
12
# File 'lib/pipeline/filters/jira_one_time_filter.rb', line 9

def initialize
  @name = "Jira One Time Filter"
  @description = "Checks that each issue that will be reported doesn't already exist in JIRA."
end

Instance Method Details

#filter(tracker) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pipeline/filters/jira_one_time_filter.rb', line 14

def filter tracker
  @project = tracker.options[:jira_project.to_s]
  @api = tracker.options[:jira_api_url.to_s]
  @cookie = tracker.options[:jira_cookie.to_s]
  @component = tracker.options[:jira_component.to_s]
  @appname = tracker.options[:appname]

  potential_findings = Array.new(tracker.findings)
  tracker.findings.clear
  potential_findings.each do |finding|
  	if confirm_new finding
  		tracker.report finding
  	end
  end
end