Trigger task-modified-event on tag- and/or metadata-change

Hi. Is there a way to let kanboard detect a change of tags and/or metadata change when saving a task?
This is neccassary to use automatic actions with TASK_MODIFIED for automatic logging. We use tags to visualize that a customer has been reminded to react on an e-mail. Now it would be helpful to log this reminding action in the description. Currenty a change of tags and metadata doesn’t seem to be logged anywhere.

Thanks for any ideas!

Same as asking:
"I have an extra room upstairs, is there a way to add a sink and toilet, to make a bathroom out of it? "

Yes, is the answer, to both questions. Not sure your expectations on that answer though.

1 Like

Thanks for the reply! Everything is possible for those who believe. Sometimes I kind of forget that.

But I thought I had a bathroom with a sink and toilet. I wanted to connect my washing machine now, because I thought there should be a connection normally. Unfortunately, I’m not a plumber, so I’m not sure if I a) just did not recognize the connection or b) need an adapter for the inlet and outlet of the sink.

In terms of kanboard, my understanding, as written, is that TASK_MODIFIED seems to be the key to triggering an automatic action when a task is saved. In my second life, I do tinker around with C# scripts inside a game engine. However, I don’t understand enough about software architecture and especially php to be able to understand the kanboard’s cause-and-effect relationships.

So “Thanks for any ideas!” referred to possible solutions to estimate if triggering an automatic action by changing a tag is realistic for my level or not. Or in other words: “Check the washing machine connection again! It has to be there”, “You need an adapter, but think carefully about whether you want to install it yourself” or “Please don’t start knocking a huge hole in the wall to lay pipes on your own (especially not where power lines are laid). Call an installer for help!”?

Peace
AD

Show me this “TASK_MODIFIED” event that you speak of.

These are the task events:

Now notice, in the TaskModificationModel:

This handles the event, and triggers it, upon update. But the important thing to notice, is the comparison of values.

Tags, are not included in that comparison, in short.

So, yes, you will need an adapter.

For some guidance, the only plugins I have done that deal with notifications are: (but this might be a bit different) They might help you.

2 Likes

Thanks a lot! Yes, I dont’t know where the TASK_MODIFIED came from. :slight_smile:
I did see this isModified function before but I wasn’t aware that TaskModificationModel.php was somehow overwritten by NewTaskModofocationModel.php in the MetaMagik Plugin. When replacing “elseif ($this->isModified($task, $changes))” with “else” in both files EVENT_UPDATE is triggered every time, the task card has been opened.

So for a clean way I have to figure our how to add some tagsModified and metaModified function and change the line in TaskModificationModel.php and NewTaskModificationModel.php to “elseif ($this->isModified($task, $changes) || tagsModified($task, $changes) || metaModified($task, $changes))”.

If I find out how to do this, I’m going to reply again.

Thanks a lot again!

I mean “elseif ($this->isModified($task, $changes) || $this->tagsModified($task, $changes) || $this->metaModified($task, $changes))”

So the following changes in TaskModificationModel.php is what helped me detect changes in tags:


Changes_in_TaskModificationModel_fireEventsUnconditional

For changes with MetaMagik installed the changes need to be done in NewTaskModificationModel.php in the Model folder in the Plugin folder.

To detected changes in meta data the following changes helped me:
Changes_in_TaskModificationModel_updateMeta1
Changes_in_TaskModificationModel_updateMeta2

The first picture already shows the changes for tags and meta changes.