0

I would like to create a constraint on an item based on the linked child items.

I have an item called "Project" that will have child items of "Task". Both of these items types have a state field and the same values like, "In Progress", "Ready For Review", "Complete", etc. What I want to do is keep the user from changing the "Project"/parent item state to the next state if all the "Task"/child items are not in the right or same state. Once all the tasks are set to the right state I would like to allow the project item state to advanced. So, is this possible, and if so could someone point me to the right docs?

Visual example:

(T1)

 Project State:In Progress
      Children:
           Task 1 State:In Progress
           Task 2 State:In Progress

(T2) - Note that at this time the user would not be able to change the project state to the next state because all the tasks are not completed.

Project State:In Progress
     Children:
           Task 1 State:Ready For Review
           Task 2 State:In Progress

(T3)

 Project State:In Progress
      Children:
           Task 1 State:Completed
           Task 2 State:Ready For Review

(T4) - Now the user can move the Project item state to Completed because all the children are in the correct state.

 Project State:In Progress
      Children:
           Task 1 State:Completed
           Task 2 State:Completed

(T5)

 Project State:Completed
      Children:
           Task 1 State:Completed
           Task 2 State:Completed
Tim Schruben
  • 1,535
  • 1
  • 12
  • 10

1 Answers1

0

as far as i know this is not possible through constraint,you may need custom rule based trigger for this functionality.

The event for the trigger will be like (type = project And state !=state[old value] And state[old value]=In Progress And state[new value]=Completed )

What this trigger will do? It will checks the state of all child tasks and if any of the child task is not completed it will pop up message saying "All the child task should be completed before moving project to completed state"

Vinay
  • 1