Using conditional logic with Forms
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Jira Forms use sections, which allow you to dynamically show or hide content based on the user's response to a previous question. In a nutshell, conditional logic in Jira Forms (formerly known as Proforma) allows you to create dynamic forms that change based on how a user interacts with them. This functionality is crucial in creating intelligent, user-friendly forms that adapt to users' inputs, ensuring that only relevant questions are displayed, and unnecessary ones are hidden. This capability improves the user experience by making forms shorter and more relevant to the specific needs or circumstances of the user.
Scenario
For this article, we'll assume that you've set up a form for your Service project but have some concerns about how to use the Forms sections.
Show a Section Based on One Condition
To create a conditional section:
Create a choice (radio button, checkbox, or dropdown) question on your form. (Note that currently multi-select dropdown questions cannot be used to trigger conditional logic.)
Click on the button Add section anywhere below the choice question.
Click on the section divider. The properties panel will allow you to have the section shown Always or Conditionally.
After selecting Conditionally you’ll be given a list of all the choice questions in the form (including questions that are part of previous conditional sections) which precede the conditional section.
Select the appropriate question. A list of choice options will appear so you can select the choices that will bring the section.
Add the relevant questions and content to the section.
Show a Section Based on Multiple Conditions
You can also nest conditional sections in order to require more than one condition to be met for a section to appear.
To do this, place the question for the second condition within a conditional section dependent on the first condition.
You can configure multiple conditions and dependencies. This means you can have complex logic where a field's visibility depends on multiple answers or a combination of specific responses.
At the moment, the conditional sections are dependent on one field condition only, but we do have an item in our development roadmap/backlog to support sections based on multiple conditions with if/then/else:
These sections work as demonstrated in the screen recording below:
Tips for Using Conditional Logic Effectively
Keep It Simple: While it's tempting to add a lot of conditional logic to make your form as comprehensive as possible, it's also important to consider the user experience. Too many conditions can make the form confusing for the user. Aim for a balance between collecting all necessary information and keeping the form simple and user-friendly.
Clearly Define Dependencies: Make sure that the logic behind showing or hiding fields is based on clear and logical dependencies. This will not only help in creating an intuitive form for the end-user but also in maintaining the form logic over time.
Use Descriptive Field Names: When setting up conditional logic, using descriptive names for your fields can make it easier to select the correct fields for each condition. It also helps you understand the form structure at a glance, especially when revisiting the form for edits or updates.
Test with Real Users: Before finalizing your form, test it with a group of real users who represent the form’s target audience. This can provide valuable insights into how the conditional logic affects the user experience and whether any adjustments are needed.
Document Your Logic: Documenting your logic and the intended user flow can be invaluable, especially for complex forms with multiple conditional paths. Therefore, naming your conditional sections can help with troubleshooting issues, making future updates, and providing a reference for the team.