locaweb / python-servicenow

Python Library to interact and manage the ServiceNow database
Apache License 2.0
96 stars 47 forks source link

inc.fetch only returns the first incident in the db #14

Closed lmaojs closed 10 years ago

lmaojs commented 10 years ago

I am trying to fetch an INC from today using this code:

from servicenow import ServiceNow
from servicenow import Connection
import getpass

pass1 = getpass.getpass('Enter Your Password plzz! xD:')

conn = Connection.Auth(username='***', password=pass1, instance='***', api='JSONv2')

inc = ServiceNow.Incident(conn)
grp = ServiceNow.Group(conn)

inc1 = inc.fetch_one({'number': 'INC0154516'})
print inc1

but it is returning a very old INC from 2011, actually it's returning the first incident ever created in the db: 'INC010001'.

wgrcunha commented 10 years ago

I found the bug, after last release to format the query, the Connection expects meta as a kwarg. I'l fix it soon. For now you can use:

inc.fetch_one(meta={'number': 'INC0154516'})

That will works

wgrcunha commented 10 years ago

Fixed on 2.0.1