← All articles

Project Management

Microsoft Planner Task Automation

Create Planner tasks from Drupal events with two-way sync, custom dashboards using Drupal Views and Charts for project tracking.

Published February 5, 2024
drupalmicrosoft-plannerproject-managementautomationdashboardsoffice365

Overview

Microsoft Planner integration brings enterprise project management capabilities to Drupal. This solution automates task creation based on content workflows, maintains bidirectional synchronization, and provides powerful visualization through custom Drupal dashboards using Views and Charts modules.

Features

  • Automated task creation from Drupal workflows
  • Two-way task status synchronization
  • Custom Drupal Views dashboards
  • Chart integration for visual analytics
  • Bucket and plan organization
  • Task assignment and progress tracking
  • Checklist item synchronization
  • Label and priority mapping

Technical Details

Technologies: Microsoft Graph API, Microsoft Planner API, Drupal Views, Drupal Charts module, Drupal Event System, Drupal Queue API

Requirements:

  • Drupal 9.x or 10.x
  • Microsoft 365 with Planner
  • Azure AD app with Group.ReadWrite.All permission
  • Drupal Views and Charts modules
  • Cron for background synchronization

API Endpoints:

Create task: POST /planner/tasks
Update task: PATCH /planner/tasks/{task-id}
List plan tasks: GET /planner/plans/{plan-id}/tasks
Get task details: GET /planner/tasks/{task-id}/details

Implementation

  1. Configure Azure AD app with Planner permissions
  2. Create Drupal entity for Planner task mapping
  3. Implement Graph API integration service
  4. Set up event subscribers for task automation
  5. Build Views plugin for Planner data source
  6. Create custom Charts integration
  7. Implement webhook handler for Planner updates
  8. Configure background sync queue
  9. Build admin UI for plan and bucket mapping
  10. Add progress tracking and reporting
<?php
// Example: Views plugin for Planner tasks
namespace Drupal\planner_integration\Plugin\views\query;

use Drupal\views\Plugin\views\query\QueryPluginBase;

/**
 * @ViewsQuery(
 *   id = "planner_tasks",
 *   title = @Translation("Planner Tasks"),
 *   help = @Translation("Query Microsoft Planner tasks")
 * )
 */
class PlannerTasksQuery extends QueryPluginBase {
  
  public function execute(ViewExecutable $view) {
    $planner_client = \Drupal::service('planner_integration.client');
    $plan_id = $view->getExposedInput()['plan_id'] ?? NULL;
    
    if (!$plan_id) {
      return;
    }
    
    // Fetch tasks from Planner
    $tasks = $planner_client->getPlanTasks($plan_id);
    
    // Transform to Views result format
    $view->result = [];
    foreach ($tasks as $index => $task) {
      $row = new ResultRow([
        'index' => $index,
        'id' => $task['id'],
        'title' => $task['title'],
        'percentComplete' => $task['percentComplete'],
        'assignees' => $task['assignments'],
        'dueDateTime' => $task['dueDateTime'],
        'bucketId' => $task['bucketId'],
      ]);
      $view->result[] = $row;
    }
    
    $view->total_rows = count($view->result);
    $view->execute_time = microtime(TRUE) - $view->build_time;
  }
}

Use Cases

  • Content production project management
  • Multi-team editorial workflows
  • Campaign planning and execution
  • Sprint planning for development teams
  • Client project tracking and reporting

Benefits

  • Visual project tracking within Drupal
  • Automated task creation from content workflows
  • Real-time synchronization across platforms
  • Comprehensive project analytics and reporting
  • Familiar Planner interface for team members
  • Reduced manual project management overhead
  • Improved team collaboration and visibility