A terminal-based ticket monitor that integrates with Sonar's GraphQL API to check for new tickets in real-time and display desktop notifications via win10toast
.
- Polls Sonar's GraphQL API every 30 seconds to check for new tickets
- Filters by ticket group(s) you define in the script
- Displays desktop toast notifications for new tickets
- Designed for Windows (due to use of
win10toast
) - Environment-based configuration for security and flexibility
- Python
requests
– for making HTTP calls to the GraphQL APIpython-dotenv
– to securely load API credentials from a.env
filewin10toast
– for Windows toast notifications
- Python 3.6+
- Windows OS (due to
win10toast
) - A valid Sonar API key
- Your organization's Sonar GraphQL endpoint
-
Clone the repository
git clone https://github.com/yourusername/sonar-ticket-monitor.git cd sonar-ticket-monitor
-
Create and populate a
.env
fileCreate a
.env
file in the root of your project and add your credentials:SONAR_API_KEY=your_sonar_api_key_here GRAPHQL_URL=https://YourOrganizationName.sonar.software/api/graphql
-
Install Dependencies
Use
pip
to install the required Python packages:pip install -r requirements.txt
-
Run the Monitor
Start the script from the terminal:
python Sonar_ticket_monitor.py
- You may need to modify the script to specify which ticket group(s) you want to monitor.
- This tool is currently limited to Windows due to its use of
win10toast
. For cross-platform support, consider swapping in a different notification library.
This tool is not affiliated with or officially supported by Sonar. Use at your own discretion and ensure you comply with your organization's data and security policies.
This project is licensed under the MIT License.
See the LICENSE
file for full license text.