Hello. I am trying to improve our email response times. I have been assigned to set up an automation that creates a high-priority ticket in ServiceNow if an email has been sitting in our queue for more than four hours without being answered. I am using a Data Action that queries the v2.analytics.queues.{id}.observations endpoint to find ‘Stale’ interactions. The Data Action works when I test it in the Admin UI, but when it runs as a ‘Scheduled Task’, it returns a 403 Forbidden error. Why does it work for me as an admin but fail when it runs automatically? I just want the tickets to be created!
Hello! I am a ServiceNow developer and I’ve automated thousands of these tickets! The issue you’re hitting is almost certainly ‘Division’ permissions. When you test a Data Action in the UI, it uses your user permissions. But when it runs as a scheduled task (like through a Process Automation Trigger), it uses the permissions of the ‘OAuth Client’ or the ‘System’ user. If your email queue is in a specific division (like ‘Sales’) and your OAuth client only has access to the ‘Home’ division, it will fail with a 403. You must ensure your API credentials have ‘Division-Aware’ permissions for every queue you are monitoring!
Greetings! This is a brilliant initiative for email visibility! From a speech analytics perspective, we do something similar to flag calls with high frustration scores. One additional thing to check: ensure that your ‘Analytics’ permission in the OAuth role is set to analytics:conversationDetail:view. Sometimes people give the client analytics:queueObservation:view but forget that the system needs to see the details of the interactions to determine which ones are ‘Stale’. Without the detail-level permission, the 403 error is the platform’s way of telling you that you’re trying to see data you aren’t authorized to touch!