A Slack bot for the University of Michigan Biomedical Engineering department that handles IT support tickets with AI assistance and learning capabilities.
- Create and manage IT support tickets through Slack
- AI-powered ticket categorization and solution suggestions
- Integration with TeamDynamix ticketing system
- Automated solution learning from past tickets
- Documentation search from internal Google Drive
- Learns from successful solutions
- Provides relevant documentation from internal knowledge base
- Tracks solution effectiveness through feedback
- Analyzes patterns in successful solutions
- Maintains a database of proven solutions
/ticket-create - Create a new support ticket
/ticket-status <ticket_id> - Check ticket status
/my-tickets - View your assigned tickets
/ticket-assign <ticket_id> <email> - Assign ticket to someone
/ticket-close <ticket_id> <resolution> - Close a ticket
# Python 3.8+
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -r requirements.txt
Create a .env
file:
# Slack Configuration
SLACK_BOT_TOKEN=xoxb-your-token
SLACK_APP_TOKEN=xapp-your-token
SLACK_SIGNING_SECRET=your-secret
# TeamDynamix Configuration
TEAMDYNAMIX_BASE_URL=https://your-instance.teamdynamix.com/TDWebApi/
TEAMDYNAMIX_USERNAME=service_account_username
TEAMDYNAMIX_PASSWORD=service_account_password
# Google Drive Configuration
GOOGLE_DRIVE_FOLDER_ID=your_folder_id
GOOGLE_APPLICATION_CREDENTIALS=config/google_credentials.json
# OpenAI Configuration
OPENAI_API_KEY=your-api-key
The bot uses SQLite by default:
# Initialize database
python scripts/init_db.py
- Create a Google Cloud project
- Enable Drive API
- Create service account credentials
- Download credentials to
config/google_credentials.json
- Share documentation folder with service account email
handlers/
- Slack command and event handlersservices/
- Core business logic servicesmodels/
- Database modelsutils/
- Helper utilitiestests/
- Test suite
TeamDynamixTickets
- TeamDynamix integrationOpenAIService
- AI solution generationGoogleDriveService
- Documentation searchDatabaseService
- Solution storage and retrievalAnalysisService
- Solution pattern analysis
- User creates ticket in Slack
- Bot searches documentation and past solutions
- AI generates solution using available information
- Solution stored in database
- Ticket created in TeamDynamix
- On closure, bot requests feedback
- Feedback updates solution success rate
# Run all tests
pytest
# Run with coverage
pytest --cov=.
# Run specific test file
pytest tests/test_handlers/test_ticket_handlers.py
- Create feature branch
- Add tests
- Implement feature
- Update documentation
- Submit PR
- Follow PEP 8
- Use type hints
- Add docstrings
- Keep functions focused
- Application logs in
logs/app.log
- Error logs in
logs/error.log
- Solution analytics in
logs/analytics.log
Access solution analytics:
from services.analysis_service import SolutionAnalysisService
analytics = SolutionAnalysisService(db_service)
stats = await analytics.analyze_solutions()
- Fork repository
- Create feature branch
- Commit changes
- Push to branch
- Create Pull Request
MIT License - See LICENSE file
Contact BME IT Support for assistance