Appendix: Technical Details
API Endpoints
FreshServices Tickets API
https://domain.freshservice.com/api/v2/tickets
Create, update, and query tickets
FreshServices Webhook
https://domain.freshservice.com/api/v2/webhooks
Register webhook endpoints for ticket events
N8N Webhook Endpoint
https://n8n.yourdomain.com/webhook/freshservice
Receive webhook events from FreshServices
Database Schema
tickets
Stores ticket data with relationships to other entities
iddisplay_idsubjectdescriptionstatusprioritycreated_atupdated_at
notes
Stores ticket conversation history
idticket_iduser_idbodycreated_at
users
Stores user information
idnameemailroledepartment_id
departments
Stores department information
idnamedescription
Workflow Example: Ticket Prioritization
// N8N JavaScript Code for Ticket Prioritization
function prioritizeTicket(ticket) {
const keywords = {
high: ['urgent', 'critical', 'emergency', 'down', 'broken'],
medium: ['issue', 'problem', 'error', 'not working'],
low: ['question', 'how to', 'help with', 'guidance']
};
// Check subject and description for priority keywords
const subject = ticket.subject.toLowerCase();
const description = ticket.description.toLowerCase();
// Determine priority based on keywords
if (keywords.high.some(word => subject.includes(word) || description.includes(word))) {
return 'high';
} else if (keywords.medium.some(word => subject.includes(word) || description.includes(word))) {
return 'medium';
} else {
return 'low';
}
}