-
Notifications
You must be signed in to change notification settings - Fork 0
/
t1.py
28 lines (22 loc) · 797 Bytes
/
t1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# t1.py
import pysnow
from config import USER, PASSWORD, INSTANCE
from datetime import datetime, timedelta
today = datetime.today()
many_days_ago = today - timedelta(days=600)
qb_query = ( pysnow.QueryBuilder()
.field('sys_created_on').between(many_days_ago, today)
.AND()
.field('priority').equals(['4'])
)
print(qb_query)
c = pysnow.Client(user=USER, password=PASSWORD, instance=INSTANCE)
print(c)
needit = c.resource(api_path='/table/x_58872_needit_needit')
print (needit)
response = needit.get(query=qb_query, fields=['number', 'priority', 'state', 'short_description'])
for record in response.all():
print (record)
response = needit.get(query={'priority' : 4}, fields=['number', 'priority', 'state', 'short_description'])
for record in response.all():
print(record)