无法使用assignment_group获取service now票证

2024-06-25 23:01:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我现在无法通过匹配分配组从服务中检索票证。我现在正在使用pysnow和表api从服务中检索票证。在

以下是我的代码:

import pysnow
c = pysnow.Client(instance='myinstance', user='username', password='password')
incident = c.resource(api_path='/table/incident')

#getting the assignment group of a ticket 
print ("tickets are")
response = incident.get(query={'number': 'INC0010020'}, stream=True)
a = response['assignment_group']
print (a)

#using the same assigment group above to fetch more tickets
response = incident.get(query={'assignment_group' : a}, stream=True)
print (response.one())

我得到以下结果:

enter image description here


Tags: theapitruestreamgetresponsegrouppassword