A Python script that automates the process of updating multiple Freshdesk tickets with status messages.
- Fetch ticket conversation details
- Add public notes to tickets
- Process multiple tickets in batch
- Check for customer replies in ticket conversations
- Automated status update messaging
- Python 3.x
requests
library- Freshdesk API credentials
- Install required dependencies:
pip install requests
- Configure your Freshdesk API credentials in the script:
FRESHDESK_DOMAIN = "your-domain.freshdesk.com"
API_KEY = "your-api-key"
-
get_ticket_details(ticket_id)
- Fetches conversation details for a specific ticket
- Returns JSON response of conversations or None if error occurs
-
add_public_note_to_ticket(ticket_id, note)
- Adds a public note to the specified ticket
- Handles success/failure responses
-
process_ticket(ticket_id)
- Processes individual tickets
- Checks for customer replies
- Adds appropriate status update notes
-
process_multiple_tickets(ticket_ids)
- Processes a list of ticket IDs in batch
- Calls process_ticket() for each ID
- Update the API credentials in the script:
FRESHDESK_DOMAIN = "your-domain.freshdesk.com"
API_KEY = "your-api-key"
-
Modify the ticket_ids list with your target ticket numbers
-
Run the script:
python Freshdesk_API_3-11-25.py
The script includes error handling for:
- Failed API requests
- Invalid ticket IDs
- Authentication errors
- Connection issues
- Keep your API credentials secure
- Don't commit the script with real credentials to version control
- Consider using environment variables for sensitive data
The script provides console output for:
- Successful ticket updates
- Failed operations with error messages
- Processing status for each ticket
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is proprietary to Motive Energy, Inc.