dev #2

Merged
igodin merged 12 commits from dev into main 2026-07-27 18:37:38 +00:00
3 changed files with 17 additions and 4 deletions
Showing only changes of commit 9cf1c6ac37 - Show all commits

View File

@ -1,6 +1,15 @@
# sdp-request-watcher
A locally run JS app to monitor for request closures using Zoho's SDP Cloud API.
# Setup
env.example contains the setup for the env requires a Non-Browser Application key from https://api-console.zoho.com/add
Technicians and Statuses are checked in the .env file
I resolved the issue with it only finding closed tickets so it should now find resolved and closed I havent tested with others but will
The technician field can have spaces after the comma however the statuses can not. There can be no spaces before the status or it wont work properly.
## Reference Materials

4
src/env.example Normal file
View File

@ -0,0 +1,4 @@
CLIENT_ID=
CLIENT_SECRET=
TECHNICIAN_NAMES=First Last, First Last
STATUS_NAMES=Closed,Resolved

View File

@ -67,9 +67,9 @@ async function fetchClosedTickets() {
fields_required: ["display_id", "subject", "status", "completed_time", "technician"],
search_criteria: [
{
field: "status.name",
field: "status.internal_name",
condition: "is",
value: "Closed"
values: statuses.map(status => status.trim())
},
{
field: "completed_time",
@ -145,7 +145,7 @@ async function main() {
await pollForToken(deviceData.device_code, deviceData.interval);
setInterval(fetchClosedTickets, 600000); //runs every 10 mins
setInterval(fetchClosedTickets, 1 * 60 * 1000); //Only change the first number the first is the amount of minutes between each run
fetchClosedTickets();
}