How to update Entity when a related Entity changes (many-to-many)

I have a many-to-many relationship between Deliverable and Work Package:

Both have their own Status relation.

My goal is:

If all Work Packages of a Deliverable have the Status “Done”, the deliverable automatically sets its Status to “Ready For Review”.

I dont know where to define the rule:

  1. in Deliverable, It seems that I cannot get a trigger when the status of a related Work Package changes. Else I suppose I could go over all related Work Packages to determine the Status of the Deliverable itself.
  2. In Work Package, when the Status changes to “Done”, I would supposedly look into every Deliverable, iterate over the Work Packages, determine their Status and change that Deliverable. That doesnt seem the right place, and I didnt manage to automate that anyhow.

Do you have any Ideas?

In this screenshot you see, that for some reason, I cannot select Work Package, as a changed field of Deliverable:

Hey Fabian! Add a formula on the Deliverable to check the percantage of work packages that are done. Ask the AI “percantage of work packages that are done” and it should make the right formula.

Then the rule should trigger when that formula changes, and is equal to 100%.

Hope it works!

Hey Ron, thanks for the tip with the indirection. That works pretty well !

1 Like