dev #2
11
README.md
11
README.md
@ -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
4
src/env.example
Normal file
@ -0,0 +1,4 @@
|
||||
CLIENT_ID=
|
||||
CLIENT_SECRET=
|
||||
TECHNICIAN_NAMES=First Last, First Last
|
||||
STATUS_NAMES=Closed,Resolved
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user