最近の検索
最近の検索はありません

Art
参加日2023年10月01日
·
前回のアクティビティ2023年10月01日
フォロー中
0
フォロワー
0
合計アクティビティ
3
投票
0
サブスクリプション
1
アクティビティの概要
バッジ
記事
投稿
コミュニティへのコメント
記事へのコメント
アクティビティの概要
さんの最近のアクティビティ Art
Artさんがコメントを作成しました:
I tried running this:
t = zenpy_client.tickets(id=200254)
#ticket_text = t.description
ticket_text = t.custom_status_id
print(ticket_text)
Having it print out the "ticket.custom_status_id" returned the same "19218874479771" number that was revealed in the API with the other query and given to me by the Zendesk support agent.
So the question remains, why does "ticket.status = 'Athena Reply'" and "ticket.status = '19218874479771'" return the error message?
コメントを表示 · 編集日時:2023年10月01日 · Art
0
フォロワー
0
投票
0
コメント
Artさんが投稿を作成しました:
I'm making a python program to help automate my workload. I'm using the Zenpy program to do it. The code will run and execute my custom functions as expected ONLY if the status line reads:
ticket.status = 'open'
It also works if the status is set to one of the other Zendesk default statuses (open, pending, solved).
However when I try to replace 'open' with my custom status titled 'Athena Reply' (which for when she replies to a ticket before me), I get the following error message:
{"error": "RecordInvalid", "description": "Record validation errors", "details": {"custom_status_id": [{"description": "Custom status is invalid", "error": "InvalidValue"}]}}
And this happens if I put in the name of the status ('Athena Reply') in either matching case as it appears on Zendesk, or lower case too. Also, after querying the API for the custom status ID, which is 19218.. or something, a very long series of numbers, the same error is returned.
Moreover, I have extensively confirmed with a very kind Zendesk support agent that the custom status ID was correct, he gave it to me, and that the information endpoint was correctly accessible.
Here is my test file I'm using to validate the functionality before integrating it into my full program:
from zenpy import ZenpyAs you can see in line 25/26 those are where the error is being triggers when line 27 runs. As mentioned above, when I write "ticket.status = 'open'" the program executes without error, closes, and the ticket in Zendesk is appropriately changed as expected. But not with the custom status or the custom status's ID.
from zenpy.lib.api_objects import Comment
import yaml
# Initialize the Zenpy client
with open('config.yaml', 'r') as cf:
config = yaml.safe_load(cf)
creds = {
'email': config['Zendesk_Email'],
'token': config['Zendesk_Key'],
'subdomain': config['Zendesk_Subdomain']
}
zenpy_client = Zenpy(**creds)
def do_the_thing():
print("Tme to do that thing!")
for ticket in zenpy_client.search_export(type='ticket', status='new', brand="Meetn"):
ticket_text = ticket.description
print("Ticket said: " + ticket_text)
Ask_Athena = handoff_to_Athena()
print("Athena said: " + Ask_Athena)
ticket.comment = Comment(body=Ask_Athena, public=False)
#ticket.status = '19218874479771'
ticket.status = 'Athena Reply'
zenpy_client.tickets.update(ticket)
do_the_thing()
投稿日時:2023年10月01日 · Art
0
フォロワー
2
投票
2
コメント