我现在无法通过匹配分配组从服务中检索票证。我现在正在使用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())
我得到以下结果:
尝试在第2行后添加以下内容:
“a”变量是一个JSON对象。尝试使用.value 在使用回答时也要注意。您可能需要使用JSON.parse如果响应以字符串形式出现
相关问题 更多 >
编程相关推荐