Dear friends, could you please advise on how to handle this? I added a webhook using the Prepare payload callback \WebhookHelper::GenerateTTOAlert, but an error occurred:
Error: The callback '\WebhookHelper::GenerateTTOAlert' is not valid.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, can you send the code of GenerateTTOAlert ?
This error means you can't call it, it can be for several reasons, wrong visibility, wrong name, etc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your reply.I have created two files in the itop/extensions/webhook_helper directory: one is main.php, and the other is webhookhelper.class.inc.php.
Dear friends, could you please advise on how to handle this? I added a webhook using the Prepare payload callback \WebhookHelper::GenerateTTOAlert, but an error occurred:
Error: The callback '\WebhookHelper::GenerateTTOAlert' is not valid.
Hello, can you send the code of GenerateTTOAlert ?
This error means you can't call it, it can be for several reasons, wrong visibility, wrong name, etc
Thank you for your reply.I have created two files in the itop/extensions/webhook_helper directory: one is main.php, and the other is webhookhelper.class.inc.php.
1.main.php
'Webhook Helper', 'description' => 'Generates dynamic payloads for enterprise WeChat webhooks', 'version' => '1.0.0', 'author' => 'Admin', 'license' => 'MIT', ); } public function ListAPIClasses() { return array( 'WebhookHelper' => 'webhookhelper.class.inc.php', ); } } ?>- webhookhelper.class.inc.php
Get('ref'); $title = $ticket->Get('title'); $status = $ticket->Get('status'); return array( 'msgtype' => 'text', 'text' => array( 'content' => "[TTO Alert]\nA ticket (ID: {$ref}) is awaiting assignment for response. Please handle it promptly!\nTitle: {$title}\nStatus: {$status}" ) ); } } ?>Thank you for the details. Where is the GenerateTTOAlert function in the webhookhelper class ?