class Hookers::Changelog::Matchers::ServiceNowMatcher

Public Class Methods

scan(commit) click to toggle source
# File lib/hookers/changelog/matchers.rb, line 52
def self.scan(commit)
  blocks_of(commit, /(INC|PRB|TICKET|CHG)(\d+)/).map { |e| new(commit, *e) }
end

Public Instance Methods

identifier() click to toggle source
# File lib/hookers/changelog/matchers.rb, line 66
def identifier
  "#{@type}#{number}"
end
type() click to toggle source
# File lib/hookers/changelog/matchers.rb, line 62
def type
  {"chg" => "CHANGE"}.fetch(@type.to_s.downcase, @type.to_s)
end
uri() click to toggle source
# File lib/hookers/changelog/matchers.rb, line 56
def uri
  uris = {"chg" => "change_request_list", "inc" => "incident_list", "prb" => "problem_list"}

  "https://lwprod.service-now.com/nav_to.do?uri=#{uris.fetch(@type.to_s.downcase)}.do?sysparm_query=number%3D#{identifier}"
end