Class: Rodzilla::Resource::Bug
- Defined in:
- lib/rodzilla/resource/bug.rb
Constant Summary collapse
- REQUIRED_FIELDS =
[:product, :component, :summary, :version, :description, :op_sys, :platform, :priority, :severity]
Instance Attribute Summary
Attributes inherited from Base
#base_url, #credentials, #format, #headers, #password, #request_url, #response, #result, #username
Instance Method Summary collapse
- #create(params = {}) ⇒ Object
- #create!(params = {}) ⇒ Object
- #fields ⇒ Object
-
#search(query = {}) ⇒ Object
Unless otherwise specified in the description of a parameter, bugs are returned if they match exactly the criteria you specify in these parameters.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Rodzilla::Resource::Base
Instance Method Details
#create(params = {}) ⇒ Object
46 47 48 |
# File 'lib/rodzilla/resource/bug.rb', line 46 def create(params={}) rpc_call( params.merge(rpc_method: 'create')) end |
#create!(params = {}) ⇒ Object
see: www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html#create
Required Fields: product (string) Required - The name of the product the bug is being filed against. component (string) Required - The name of a component in the product above. summary (string) Required - A brief description of the bug being filed. version (string) Required - A version of the product above; the version the bug was found in. description (string) Defaulted - The initial description for this bug. Some Bugzilla installations require this to not be blank. op_sys (string) Defaulted - The operating system the bug was discovered on. platform (string) Defaulted - What type of hardware the bug was experienced on. priority (string) Defaulted - What order the bug will be fixed in by the developer, compared to the developer’s other bugs. severity (string) Defaulted - How severe the bug is.
Raises an exception if a required field is not provided
41 42 43 44 |
# File 'lib/rodzilla/resource/bug.rb', line 41 def create!(params={}) REQUIRED_FIELDS.each { |field| raise ArgumentError, "Error: #{field} is required" unless params[field] } rpc_call( params.merge(rpc_method: 'create' )) end |
#fields ⇒ Object
6 7 8 |
# File 'lib/rodzilla/resource/bug.rb', line 6 def fields rpc_call( rpc_method: "fields" ) end |
#search(query = {}) ⇒ Object
Unless otherwise specified in the description of a parameter, bugs are returned if they match exactly the criteria you specify in these parameters. That is, we don’t match against substrings–if a bug is in the “Widgets” product and you ask for bugs in the “Widg” product, you won’t get anything.
Criteria are joined in a logical AND. That is, you will be returned bugs that match all of the criteria, not bugs that match any of the criteria.
Each parameter can be either the type it says, or an array of the types it says. If you pass an array, it means “Give me bugs with any of these values.” For example, if you wanted bugs that were in either the “Foo” or “Bar” products, you’d pass:
Valid values: product, url, id, alias, limit
23 24 25 |
# File 'lib/rodzilla/resource/bug.rb', line 23 def search(query={}) rpc_call( query.merge(rpc_method: 'search') ) end |