Conditions
🟦 How to activate and deactivate work packages and questions with conditions
This text provides background information. What types of text are there?
Conditions are a central tool in Leadtime project components that increase flexibility and dynamics in project planning and execution. They make it possible to show or hide elements within a project component based on previously given answers. Since not all work steps or services are relevant for every project, conditions control the component so that only the appropriate content is displayed.

An example: A company offers the creation of websites. The basic services are always the same, but there are various additional functions that customers can optionally book. If a customer indicates that they want a blog, additional work packages for setting up and designing the blog automatically appear. If the customer does not want a blog, these packages remain hidden.
Conditional work packages, checklists and acceptance tests
In Leadtime, it is possible to display work packages, checklists and acceptance tests only if certain conditions are met. This allows dependencies between different elements within a component to be mapped. This ensures that only relevant work steps are displayed - depending on previous decisions or results.

Functionality
1. create work package, checklist or acceptance test
First, the element that should only appear under certain conditions is created. This can be a new work package, a checklist or a set of acceptance tests.
2. add condition
The "Conditions" area is located in the form for creating or editing the element.
Click on "Add Condition" there.
3. define target element
This defines which other element controls the condition.

The target can be:
- Question in a work package (e.g. selection option in the request form)
- To-do in a checklist (e.g. "Design template created" ticked off)
- Test case in an acceptance test (e.g. "Contact form tested")
Note: The target element does not necessarily have to be in the same project component. If you later create a project that consists of several components, conditions can also be defined across components. For example, a work package in component B can be made dependent on how a question was answered in component A
When does this make sense?
Imagine you have a project component A for the creation of a website and a project component B for the integration of a blog. A customer commissions a project that includes both - a website with a blog.
With a cross-component condition, you could now control that certain work packages only become visible in the blog component if a certain decision has been made beforehand in the website area.
Example:
In website component A, the question is asked: "Is there a design template?"
- If the answer is "No", the work package "Design blog design" is automatically displayed in blog component B.
- If the answer is "Yes", this work package remains hidden because the design is already covered by the template.
4. define condition type
Condition | available for checklist | Available for acceptance test | Available for work package | Comment |
To Do is completed | Yes | no | no | Work package appears when task is marked as completed in checklist |
To Do is not completed | Yes | No | no | Work package only appears if task in checklist has not yet been completed |
Test case passed | no | Yes | No | Work package appears if test case has been marked as passed |
Test case failed | no | Yes | No | Work package appears if test case was marked as failed |
Question has been answered | no | no | Yes | Work package appears if selected question has been processed |
Question has not been answered | no | no | Yes | Work package appears if selected question has not yet been processed |
Answer contains | no | no | Yes | Use for checkboxes: It is checked whether one or more of the possible answers have been selected |
Answer does not contain | no | no | Yes | Use for checkboxes: It is checked whether one or more of the possible answers were not selected |
Answer is the same | no | no | Yes | Use with radio buttons: It is checked whether the selected answer corresponds exactly to the specified option |
Answer is not the same | no | no | Yes | Use with radio buttons: It is checked whether the selected answer does not correspond to the specified option |
5. multiple conditions

It is also possible to have an element only appear if several conditions are fulfilled at the same time. In this example, the element only appears if both specified questions have already been answered.
Conditional questions
Conditional questions make it possible for certain questions within a work package to only appear if a defined condition has already been fulfilled.
What does this mean in concrete terms?
Not every question is always relevant for every project. Some information is only required if a certain scenario applies. Conditional questions can prevent the user from seeing an unnecessarily large number of questions that do not apply to them.
When does it make sense to use them?
Conditional questions are used when a question only makes sense if a previous question has been answered in a certain way.

Example:
A work package contains the following query:
- Does your website need a contact form?(Answer options: Yes / No)
- Which fields should the contact form contain?(Free text or selection fields) This follow-up question should only appear if the answer to the first question is "Yes".
If the user selects "No", the second question is not even displayed, as it is not relevant in this case.
Inactive elements
If a component is used in a project that contains conditional elements, the elements whose conditions are not fulfilled are displayed semi-transparently in the project tree.

The effort of an inactive element is of course not added to the total project effort.
If you click on a deactivated element, the reason is explained in the right-hand column. If it is clear that an element is really not needed in a project, you can delete it from the project. Of course, this does not delete the element from the template in the component library.