Automatically set task end date based on start date and a label

I have some tasks that are “long” (end date = start date + 10) and some that are “short” (end date = start date + 3). When creating these tasks I label them “short” or “long” and I’m wondering if there is a way to automatically set the end date based on the start date and the label?

There isn’t really a way to do this in Vikunja itself. You could build this with the n8n integration though.

Thank you for the quick reply @kolaente, I really appreciate it! Can you point me towards an example of such an integration?

There isn’t really a ready-made example for what you’re doing that I know of. Here’s how you could approach this:

  1. Set up a Webhook trigger in n8n that activates when a label is updated or added to a task. This is the task.updated event, which is also triggered when a label is added to a task.
  2. Create a workflow that checks the label of the task:
    • If the label is “short”, set the end date to the start date + 3 days
    • If the label is “long”, set the end date to the start date + 10 days
  3. Use n8n nodes to update the task’s end date based on the calculation.

I would recommend installing n8n and the Vikunja nodes and then playing around with it a little

1 Like

Thank you for your guidance!

I feel like such n8n integration would be not as easy as described, because we’ll also need to handle the conflicts, right?
Let’s say I’m editing the task from UI, setting the start date, putting label “short” and then, assuming the end date will be automatically derived from start date, I proceed with task’s description.
When I click “save” I see that my version without end date is what gets saved even though the end date was added by the n8n integration.

I’m sorry if it’s wrong, but that’s what I expect it work like based on my tests of updating the task through API while editing it.
Is there a way to force UI to actually propagate background change to the UI in real-time?

That’s unfortunately not as easy as flipping a switch. We have it on the roadmap though.

1 Like

Thank you for your response! Could you please share some discussion threads on this topic?

These are all related to real-time:

1 Like