Action when comment added to task

Hi!
I would need that some specific action would be performed when a comment is added to a task (move the task to another column). I’ve been looking in the automated actions and plugins, but couldn’t find how to do it.
Do you know if this is possible, or some kind of workaround (I can’t figure out any)? I prefer to ask here before doing a feature request.
Thanks in advance.
Best regards,

This one sends an email when a comment is added.

Should give you enough to get started, and do whatever you want when a comment is added.

Hi! Wishing anyone can help me :slight_smile: I’m basing on @creecros SendEmailCreator plugin wherein I need the task to update to a specific color whenever a new comment is made but I can’t get it to work :frowning: I’m really amateur in PHP. Please help!

This is my code so far:

<?php

namespace Kanboard\Plugin\SendEmailCreator\Action;

use Kanboard\Model\TaskModel;
use Kanboard\Model\CommentModel;
use Kanboard\Action\Base;

class SendTaskComment extends Base
{
   
    public function getDescription()
    {
        return t('Send new comments on a task by email');
    }

   
    public function getCompatibleEvents()
    {
        return array(
            CommentModel::EVENT_CREATE,
	);
    }

   
    public function getActionRequiredParameters()
    {
        return array(
		    'color_id' => t('Color'),
    /**
	        'subject' => t('Email subject'),
	        'send_to' => array('assignee' => t('Send to Assignee'), 'creator' => t('Send to Creator'), 'both' => t('Send to Both')),
	        'check_box_include_title' => t('Include Task Title and ID in subject line?'),
	*/
        );

    }

   
    public function getEventRequiredParameters()
    {
        return array(
            'task_id',
            'comment_id',
            'task' => array(
                'project_id',
                'comment_id',
            ),

        );
    }

    
    public function doAction(array $data)
    {

        $values = array(
            'task_id' => $data['task_id'],
            'comment_id' => $data['comment_id'],
            'color_id' => $this->getParam('color_id'),
        );

        return $this->taskModificationModel->update($values, false);
    }


   
    public function hasRequiredCondition(array $data)
    {
        return $data['task']['comment_id'] == $this->getParam('comment_id');
    }
}

I can see lots of things wrong with it.

revert back to my original code, and focus ONLY on the doAction and getActionRequiredParameters.

post your updated code again if you can’t figure it out. way too much wrong with current code for me to spend anytime telling you what you have done wrong.