APITemplate
Bugzilla::Bug class is to access the Bugzilla::WebService::Bug API that allows you to file a new bug in Bugzilla or get information about bugs that have already been filed.
Get the bugs information from Bugzilla. either of String or Numeric or Array would be acceptable for bugs. you can specify the fields you want to look up with fields.
FWIW this name conflicts to Bugzilla API but this isn's a primitive method since get_bugs method in WebService API is actually deprecated.
# File lib/bugzilla/bug.rb, line 64 def get_bugs(bugs, fields = ::Bugzilla::Bug::FIELDS_SUMMARY) params = {} if bugs.kind_of?(Array) then params['ids'] = bugs elsif bugs.kind_of?(Integer) || bugs.kind_of?(String) then params['ids'] = [bugs] else raise ArgumentError, sprintf("Unknown type of arguments: %s", bugs.class) end unless fields.nil? then unless (fields - ::Bugzilla::Bug::FIELDS_ALL).empty? then raise ArgumentError, sprintf("Invalid fields: %s", (::Bugzilla::Bug::FIELDS_ALL - fields).join(' ')) end params['include_fields'] = fields end result = get(params) if fields.nil? || fields == ::Bugzilla::Bug::FIELDS_ALL then get_comments(bugs).each do |id, c| result['bugs'].each do |r| if r['id'].to_s == id then r['comments'] = c['comments'] r['comments'] = [] if r['comments'].nil? break end end end end # 'bugs' is only in interests. # XXX: need to deal with 'faults' ? result['bugs'] end
# File lib/bugzilla/bug.rb, line 107 def get_comments(bugs) params = {} if bugs.kind_of?(Array) then params['ids'] = bugs elsif bugs.kind_of?(Integer) || bugs.kind_of?(String) then params['ids'] = [bugs] else raise ArgumentError, sprintf("Unknown type of arguments: %s", bugs.class) end result = comments(params) # not supporting comment_ids. so drop "comments". result['bugs'] end
# File lib/bugzilla/bug.rb, line 338 def __add_attachment(cmd, *args) requires_version(cmd, 4.0) # FIXME end
# File lib/bugzilla/bug.rb, line 343 def __add_comment(cmd, *args) requires_version(cmd, 3.2) # FIXME end
# File lib/bugzilla/bug.rb, line 348 def __update(cmd, *args) requires_version(cmd, 4.0) # FIXME end
# File lib/bugzilla/bug.rb, line 353 def __update_see_also(cmd, *args) requires_version(cmd, 3.4) # FIXME end
# File lib/bugzilla/bug.rb, line 248 def _attachments(cmd, *args) requires_version(cmd, 3.6) raise ArgumentError, "Invalid parameters" unless args[0].kind_of?(Hash) @iface.call(cmd, args[0]) end
# File lib/bugzilla/bug.rb, line 256 def _comments(cmd, *args) requires_version(cmd, 3.4) raise ArgumentError, "Invalid parameters" unless args[0].kind_of?(Hash) @iface.call(cmd, args[0]) end
# File lib/bugzilla/bug.rb, line 311 def _create(cmd, *args) raise ArgumentError, "Invalid parameters" unless args[0].kind_of?(Hash) required_fields = [:product, :component, :summary, :version] defaulted_fields = [:description, :op_sys, :platform, :priority, :severity] res = check_version("3.0.4") unless res[0] then required_fields.push(*defaulted_fields) end required_fields.each do |f| raise ArgumentError, sprintf("Required fields isn't given: %s", f) unless args[0].include?(f) end res = check_version(4.0) unless res[0] then raise ArgumentError, "groups field isn't available in this bugzilla" if args[0].include?("groups") raise ArgumentError, "comment_is_private field isn't available in this bugzilla" if args[0].include?("comment_is_private") else if args[0].include?("commentprivacy") then args[0]["comment_is_private"] = args[0]["commentprivacy"] args[0].delete("commentprivacy") end end @iface.call(cmd, args[0]) end
Raw Bugzilla API to obtain the information about valid bug fields, including the lists of legal values for each field.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to obtain the information what values are allowed for a particular field.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to obtain the information about attachments, given a list of bugs and/or attachment ids.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to obtain the information about comments, given a list of bugs and/or comment ids.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to obtain the information about particular bugs in the database.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to obtain the history of changes for particular bugs in the database.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to search for bugs based on particular criteria.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
Raw Bugzilla API to create a new bug in Bugzilla.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html
# File lib/bugzilla/bug.rb, line 214 def _fields(cmd, *args) requires_version(cmd, 3.6) params = {} if args[0].kind_of?(Array) then x = args[0].map {|x| x.kind_of?(Integer)}.uniq if x.length == 1 && x[0] then params['ids'] = args[0] else x = args[0].map {|x| x.kind_of?(String)}.uniq if x.length == 1 && x[0] then params['names'] = args[0] end end elsif args[0].kind_of?(Hash) then params = args[0] elsif args[0].kind_of?(Integer) then params['ids'] = [args[0]] elsif args[0].kind_of?(String) then params['names'] = [args[0]] elsif args[0].nil? then else raise ArgumentError, "Invalid parameters" end @iface.call(cmd, params) end
# File lib/bugzilla/bug.rb, line 264 def _get(cmd, *args) params = {} if args[0].kind_of?(Hash) then params = args[0] elsif args[0].kind_of?(Array) then params['ids'] = args[0] elsif args[0].kind_of?(Integer) || args[0].kind_of?(String) then params['ids'] = [args[0]] else raise ArgumentError, "Invalid parameters" end if check_version(3.4)[0] then params['permissive'] = true end @iface.call(cmd, params) end
# File lib/bugzilla/bug.rb, line 284 def _history(cmd, *args) requires_version(cmd, 3.4) params = {} if args[0].kind_of?(Hash) then params = args[0] elsif args[0].kind_of?(Array) then params['ids'] = args[0] elsif args[0].kind_of?(Integer) || args[0].kind_of?(String) then params['ids'] = [args[0]] else raise ArgumentError, "Invalid parameters" end @iface.call(cmd, params) end
Generated with the Darkfish Rdoc Generator 2.