lib/bugzilla/bug.rb
def _create(cmd, *args)
      raise ArgumentError, 'Invalid parameters' unless args[0].is_a?(Hash)

      required_fields = %i[product component summary version]
      defaulted_fields = %i[description op_sys platform priority severity]

      res = check_version('3.0.4')
      required_fields.push(*defaulted_fields) unless res[0]
      required_fields.each do |f|
        raise ArgumentError, format("Required fields isn't given: %s", f) unless args[0].include?(f)
      end
      res = check_version(4.0)
      if res[0]
        if args[0].include?('commentprivacy')
          args[0]['comment_is_private'] = args[0]['commentprivacy']
          args[0].delete('commentprivacy')
        end
      else
        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')
      end

      @iface.call(cmd, args[0])
    end
def _create(cmd, *args)
      raise ArgumentError, 'Invalid parameters' unless args[0].is_a?(Hash)

      required_fields = %i[product component summary version]
      defaulted_fields = %i[description op_sys platform priority severity]

      res = check_version('3.0.4')
      required_fields.push(*defaulted_fields) unless res[0]
      required_fields.each do |f|
        raise ArgumentError, format("Required fields isn't given: %s", f) unless args[0].include?(f)
      end
      res = check_version(4.0)
      if res[0]
        if args[0].include?('commentprivacy')
          args[0]['comment_is_private'] = args[0]['commentprivacy']
          args[0].delete('commentprivacy')
        end
      else
        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')
      end

      @iface.call(cmd, args[0])
    end
def _search