Hi everyone
I’m looking for some help to create a new automatic action based on comment.create event.
I have no idea why my action / event is never triggered…
Expected : move a task on specific swimlane when comment is added.
(Of course, automatic action is created from UI in my settings project :P)
Plugin.php :
$this->actionManager->register(new MoveTaskSwimlaneOnComment($this->container));
$this->eventManager->register(CommentModel::EVENT_CREATE, "Création d'un commentaire");
Action/MoveTaskSwimlaneOnComment.php :
<?php
namespace Kanboard\Plugin\devTestsPlugin\Action;
use Kanboard\Action\Base;
use Kanboard\Model\CommentModel;
class MoveTaskSwimlaneOnComment extends Base
{
public function getDescription()
{
return t('Déplacer la tâche dans une swimlane lorsqu\'un commentaire est laissé');
}
public function getCompatibleEvents()
{
return array(
CommentModel::EVENT_CREATE,
);
}
public function getActionRequiredParameters()
{
return array(
'swimlane_id' => t('Swimlane'),
);
}
public function getEventRequiredParameters()
{
return array(
'task_id',
);
}
public function doAction(array $data)
{
$values = array(
'id' => $data['task_id'],
'swimlane_id' => $this->getParam('swimlane_id'),
);
return $this->taskModificationModel->update($values);
}
public function hasRequiredCondition(array $data)
{
return true;
}
}
Nothing in apache logs, nothing with DEBUG, comment is created without triggering anything
If you have any idea it could be great !
Thanks