Plugin dev : how to notify automatic actions into an automatic action

Hi,

I’m trying to improve my plugin https://github.com/jbarotin/kanboard_auto_task_push_pull / Improvement Idea / plugin look up : automatic action for tasks shifting

I want to notify the EVENT_MOVE_COLUMN, on all the automatic action of the project, when the task is moved.

I think there is something to do to that in the Kanboard code, but I didn’t found it. I’ll be glad, if anybody can help me about that ?

In fact, I’m using function movePosition in app/Action/Base.php, it calls fireEvent … so It should works automatically. I’ll review my code about this.

What should work. When you fire the event, what?

From my understanding, if I call the method movePosition, then the event EVENT_MOVE_COLUMN should be triggered automatically :

To clarify my purpose I working like this :

  • Backlog col (unlimited)
  • Next sprints col (limited to 16)
  • Current sprint col (limited to 8)
  • Work in progress col (limited to 3)

I configured my plugin in tree automatic actions :

  1. push/pull backlog to next string
  2. push/pull next sprint to current sprint
  3. push/pull work current sprint to work in progress

My issue is If I move a task from the “current sprint” to the "work in progress, I need automatics actions 2. and 3. to be executed automatically.

When I get a moment, I’ll take a look, unless someone beats me to it.

Basically, you are setting up your action 3 times and expecting the fired event thats called during the action to trigger the next action, which in theory, it should. Correct?

Thanks, for your time. I think I should be able to resolve the issue by myself.

But, I’d like to set some unit tests. I’m not really a php developper. I do not understand how to properly execute the phpunit 'PluginTest.php file' while including all kanboard source workspace to make it works.

Have you a solution for this ? (Environment variable…)

Travis CI, for tests. Setup in a yml, I dont really understand it either.

About the automatic action firing the events, the problem is that you’re calling the move method with its 6th parameter (that is the $fire_events) false:

Change it to true and it should work

Nice @rafaelcamargo it works, thanks a lot.