How to get the earliest start date between subtasks


I want to create an automation that checks, and gets the earliest start date between all subtasks in ClickUp, and update the parent task start date.

Is there any way that I can use to get only the earliest start date.

I am trying to use MIN(start_date) but I get the wrong invalid date format error.

Thanks in advance,

Hi @Judy_Dibsi,

I need to study the Clickup API as I believe this should be possible to do via Make an API call, not sure on this though.

However, the easiest way you can do is,

  1. Setup List Substaks for Tasks
  2. Add an Array aggregator after that
  3. Use sort function to get the oldest data out of the results

Screenshot from 2023-06-12 18-09-34

This should get you the earliest start date out of all the subtasks.


Thanks for replying! I’ll give it a try.

Thanks! Is there any way to edit the parent task of the subtasks? I tried to switch Parent and Task ID value, sometimes it works and most of the time not

Sorry about the late response.

What do you mean by editing the parent task of the subtasks? You can get the Parent ID from subtasks or since you are already using that in Listing the Subtasks.

Can you share me the mapping you are doing for it, so I can review it?

1 Like

Hi Runcorn,

Thanks for replying, below is an example of what I am trying to do because I want to see the subtasks start dates, get the earliest among them and then edit the parent task with this earliest date:

However, sometimes I get an error of invalid Task ID, and I think because I replaced between the Task ID and Parent ID.

My question: what is the best way to edit the parent task after watching the subtasks values?

Thanks a lot

Also, I have tried the solution you talked about, but I am getting the last or first task start date, do you happen to have a blueprint of a working example?

Thank you

Hey @Judy_Dibsi , with the greate guidance and function @Runcorn has given you can find the data for the earliest start date. Now once you have that, you can expand the function a bit to extract the parent ID and also the start_date itself.
I have been using the “Set variables” but you can do all of these functions in the clickup module iself to save you 1 execution :wink:

{{get(first(sort(2.array); "start_date"); "parent")}}

Will give you the parent ID

Below shows you how to grab the parent and start date from the array. Make sure that in the aggregator you select these values so its there.

It will then output something like this:

You can use this in an “Edit Task” module and map the correct values.

1 Like

Hi @Bjorn.drivn,

Thanks for your reply.

When I tried the first(sort(array; start_date)) I was getting the first in the array index start date not the earliest. I am trying your solution, but it would be very helpful if you have a working blueprint example to import it, please.

Thank you

Hey @Judy_Dibsi ,

To make sure the sorting is done correctly, you can add an order of either “asc” or “desc”:

{{first(sort(2.array; "asc"; "start_date"))}}

Here is the blueprint you can have a look at:

Sort clickup tasks with start date.json (42.6 KB)

Thanks a lot @Bjorn.drivn It works perfectly!

Hi again,

Just a small question, is there any way where I could update Level 2 or 3 of the subtasks?

I mean subtasks of the subtasks?

and what if some of them have no due dates or start dates?

Many thanks