# Project task dependencies

**URL:** <https://community.fibery.io/t/project-task-dependencies/1798>\
**Category:** Fibery Showcase\
**Created:** [July 13, 2021, 11:06pm UTC](https://community.fibery.io/t/project-task-dependencies/1798 "2021-07-13T23:06:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 13, 2021, 11:06pm UTC](https://community.fibery.io/t/project-task-dependencies/1798/1 "2021-07-13T23:06:44Z")

</div>

I decided to create a simple App to demonstrate how to achieve Gantt chart-lite functionality.  
The App has one Type (Task) and each Task can have zero, one or more predecessor Tasks (and zero, one or more successor Tasks). When the dates are changed for a Task, any successor tasks are automatically shuffled to start at the latest finish time of all their predecessors, whilst maintaining duration.  
Hope that makes sense, and it might help someone.

> **[Fibery | Start for free, upgrade when you love it](https://shared.fibery.io/sign-up?appShareId=d65814be-8588-49fb-acdd-b997cae4a648-dependencies)**
>
> Create Fibery account. Build your company workspace with no code.

You’ll need to makes sure that you don’t create any circular dependencies, or the snake will forever be chasing its tail 🙂

---

<div class="post-metadata">

**Author:** ![mdubakov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mdubakov/32/10_2.png) [@mdubakov](https://community.fibery.io/u/mdubakov)\
**Post date:** [July 14, 2021, 4:57am UTC](https://community.fibery.io/t/project-task-dependencies/1798/2 "2021-07-14T04:57:17Z")

</div>

@Chr1sG I am not sure the link you’ve added is correct here. Did you copy it from Share as Template action for an app? In general it should look like this `https://shared.fibery.io/t/2cc63797-57ac-429e-9815-6d0636ba1ebf-product-management`

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 14, 2021, 8:37am UTC](https://community.fibery.io/t/project-task-dependencies/1798/3 "2021-07-14T08:37:23Z")

</div>

Yes, that’s what I did.  
I think the problem lies with discourse. I pasted in the following text:  
[https://shared.fibery.io/t/d65814be-8588-49fb-acdd-b997cae4a648-dependencies](https://shared.fibery.io/t/d65814be-8588-49fb-acdd-b997cae4a648-dependencies)  
but it seems like it gets automatically converted into a different url ☹

(it replaces the `/t/` with `/sign-up?appShareId=`, I don’t know why)

Also, having tried to import it into another workspace, it looks as though the automation rule gets lost, so it doesn’t work anyway ☹  
I guess template sharing doesn’t support automation rules?

---

<div class="post-metadata">

**Author:** ![antoniokov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/antoniokov/32/201_2.png) [@antoniokov](https://community.fibery.io/u/antoniokov)\
**Post date:** [July 14, 2021, 5:57pm UTC](https://community.fibery.io/t/project-task-dependencies/1798/4 "2021-07-14T17:57:29Z")

</div>

Unfortunately, Rules are not yet supported in the template sharing 🎃  
The support is in our plans — we’ll let know once it goes live.

Sorry for the unpleasant surprise.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 14, 2021, 6:50pm UTC](https://community.fibery.io/t/project-task-dependencies/1798/5 "2021-07-14T18:50:04Z")

</div>

Ah well, c’est la vie.

For anyone who is interested in getting it to work, here’s the automation rule that I used:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/0/00c6679507ff0d713c7061acf7a9fafbf8229868.png)

and the script is as follows (which I’m sure could be done better, but I’m no SW engineer 🙂 ):

```auto
const fibery = context.getService('fibery');
for (const entity of args.currentEntities) {
    const x = await fibery.getEntitiesByIds(entity.type, [entity.id], ["Predecessors finish", "Duration"]);
    const pFinish = Date.parse(x[0]['Predecessors finish'])
    const duration = x[0]['Duration']
    const newEnd = new Date(pFinish + 86400000 * duration);
    await fibery.updateEntity(entity.type, entity.id, {
        'Dates': {
            "start": x[0]['Predecessors finish'],
            "end": newEnd
        }
    });
}

```

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 5, 2021, 10:03pm UTC](https://community.fibery.io/t/project-task-dependencies/1798/6 "2021-08-05T22:03:56Z")

</div>

> [@antoniokov](#):
>
> Unfortunately, Rules are not yet supported in the template sharing

Seems to be working now 🙂

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 5, 2021, 10:12pm UTC](https://community.fibery.io/t/project-task-dependencies/1798/7 "2021-08-05T22:12:43Z")

</div>

FYI I’ve added a conditional color on the Gantt chart that reflects if a task has been manually adjusted (overriding the automated scheduling).

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 11, 2023, 5:40pm UTC](https://community.fibery.io/t/project-task-dependencies/1798/8 "2023-01-11T17:40:02Z")

</div>

I’ve made an updated version that doesn’t involve any scripting.  
Have a look here:  
'[Dependencies — Fibery](https://shared.fibery.io/t/480c4714-1dc1-446c-aed1-05a7e59da6d5-dependencies)

It doesn’t have the ‘manual rescheduling’ function, so tasks are automatically scheduled to start when their predecessors end.
