The Organized Tasks Report (rp9) is a new report type that organizes tasks according to the specific priority and functional categories as requested. This report is specifically designed for clean email delivery with all tags removed from task titles, descriptions, and notes.
-
Categorized Task Organization:
- Tasks are automatically categorized based on the exact numbered categories specified
- Categories are grouped by functional areas as specified in the requirements
- Within each category, tasks are sorted by due date
-
Tag Removal for Clean Email Delivery:
- All tags (text within square brackets) are removed from task titles, descriptions, and notes
- This ensures clean presentation when sending reports via email
-
Enhanced Visual Formatting:
- Professional report header and footer for clear document boundaries
- Well-structured sections with clear visual separators
- Improved indentation and task relationship visualization
- Descriptive task details with clear hierarchy indicators (└─ for descriptions)
-
Colorful Terminal Output:
- When viewed in the terminal with Rich library support, the report uses colors for better readability
- Different elements are color-coded for quick visual scanning
- Group headers are displayed in blue
- Category headers are displayed in yellow
- Task numbers are displayed in green
- Due dates are displayed in cyan
- Notes are displayed in magenta
- Descriptions are dimmed for visual hierarchy
-
Professional Category Titles:
- Category titles have been improved to be more professional and clear
- Instead of "Tasks with "cr" tag ", it now shows "Change Request Tasks"
- All category titles have been simplified and made more descriptive
- Group headers are clearly marked and separated for easy navigation
-
Multiple Export Formats:
- Text format for terminal viewing (with color support when available)
- CSV format for spreadsheet import
- Ready for PDF export integration
-
Timezone Handling:
- Properly handles both timezone-aware and timezone-naive datetime objects
- Avoids datetime comparison errors that can occur with mixed timezone formats
-
Filtering Options:
--only-title: Shows only task titles, without descriptions or notes--no-other-tasks: Hides the "Other Tasks (not matching any category)" section
The report organizes tasks into the following exact categories grouped by functional areas:
- Highest Priority Tasks (***** tag)
- Highest Priority Tasks (p1 tag)
- Medium Priority Tasks (*** tag)
- Medium Priority Tasks (p2 tag)
- Defect/Bug Tasks
- In Testing Tasks
- Frontend Tasks (FE tag)
- Backend Tasks (BE tag)
- Dependency Tasks (DEP tag)
- UAT Phase Tasks (in-uat tag)
- Pending Testing Tasks (PET tag)
- Pending Development Tasks (PDEP tag)
- Pending Estimation Tasks (PE tag)
- Pending Tasks
- Pending Production Tasks (pending-prod tag)
- Today's Tasks (today tag)
- Daily Tasks (daily tag)
- To-Do Tasks (todo tag)
- This Week Tasks (this-week tag)
- Delivery Today Tasks (DEL-T tag)
- Meeting Tasks (meeting/meetings tag)
- Security Tasks (vapt/waf tag)
- Event Tasks (events tag)
- Go-Live Tasks (go-live: tag)
- Project Management Tasks (pm tag)
- Estimation Tasks (estimation tag)
- Upcoming Change Request Tasks (upcoming-cr tag)
- Change Request Tasks (cr tag)
- Long-term Tasks (long-term tag)
- Hold Tasks (HOLD tag)
- Study Tasks (study tag)
To generate the organized tasks report:
gtasks generate-report rp9To send the report via email (as specified in the requirements):
gtasks generate-report rp9 --email suresh.das@intglobal.comTo export in CSV format:
gtasks generate-report rp9 --export csv --output organized_tasks.csvTo show only task titles without descriptions or notes:
gtasks generate-report rp9 --only-titleTo hide the "Other Tasks (not matching any category)" section:
gtasks generate-report rp9 --no-other-tasksTo use both options together:
gtasks generate-report rp9 --only-title --no-other-tasksThe report is implemented as a separate class OrganizedTasksReport that extends the base BaseReport class. It uses the existing tag extraction utilities to identify and categorize tasks, and implements the tag removal functionality for clean presentation.
- Tag-based Categorization: Tasks are categorized based on the presence of specific tags according to the exact numbering scheme and grouping
- Date-based Sorting: Within each category, tasks are sorted by due date
- Tag Removal: All square bracket tags are removed from task content for clean display
- Enhanced Formatting: Professional report structure with clear headers, footers, and visual separators
- Color Support: Uses the Rich library for colorful terminal output when available
- Multiple Export Formats: Supports both text and CSV export formats
- Timezone Handling: Properly handles timezone-aware and timezone-naive datetime objects
- Filtering Options: Supports
--only-titleand--no-other-tasksoptions for customized output
- The report is registered with ID
rp9in the generate_report.py command - It follows the same pattern as other reports in the system
- It uses the existing tag_extractor.py utilities for tag processing
- The tag removal functionality is implemented in the _remove_tags_from_task_fields method
- Timezone handling is implemented in the _normalize_datetime method to prevent comparison errors
- Enhanced formatting is implemented in the _export_txt method
- Filtering options are implemented in both _export_txt and _export_csv methods
The report includes robust error handling for common issues:
- Timezone Handling: Properly normalizes datetime objects to prevent comparison errors between timezone-aware and timezone-naive objects
- None Data Handling: Gracefully handles cases where no data is available for report generation
- Data Structure Validation: Validates data structures before attempting to access their properties
- Color Library Fallback: Gracefully degrades to plain text output when the Rich library is not available
A comprehensive test suite is included in test_rp9_report.py that verifies:
- Report generation functionality
- Task categorization accuracy according to the exact numbering scheme and grouping
- Tag removal effectiveness
- Export format support
- Date-based sorting within categories
- Timezone-aware datetime handling
- Error handling for None data
- Color output support
- Filtering options (
--only-titleand--no-other-tasks)
Possible future enhancements include:
- PDF export support
- Custom category definitions
- Additional sorting options
- Integration with email sending functionality
- Custom filtering options