Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to Dynamically Add Sections in a Jira Form Based on User Input?

Manuel Alvarez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2024

Hi Atlassian Community,

I'm currently working on a project in Jira where I need to create a dynamic form that can add sections based on a user-selected value. The challenge I'm facing is to dynamically generate identical sections for each entry a user specifies in a previous field.

To illustrate with an example, let's say the form

is for entering passenger information for a flight. If a user indicates there are 3 passengers (using a numeric field), I need the form to automatically generate 3 identical sections, each dedicated to capturing the details for one passenger.

Could anyone guide me on how to achieve this in a Jira form? Are there any specific plugins, scripts, or built-in functionalities that I can leverage to create such dynamic forms?

Thank you in advance for your help!

1 answer

2 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2024

Hi @Manuel Alvarez,

Welcome to Atlassian Community!

You cannot add new sections dynamically based on a number field the way you are describing. Those sections would have to already exist in the form for it to work. So lets say that you want to allow 1 - 10 passengers to be added, the you would have to have 10 sections defined in the form with identical fields.  

Manuel Alvarez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2024

Hi @Mikael Sandberg , thanks for the answer.

So the best solution would be having a final question after each section that triggers the unlocking of the following one.

Like:
Is there any passenger left?

  • Yes
  • No

 

Do you know how this would impact making API requests?
For example the response would have a JSON structure nested by the section name?

something like this? but in a proper JSON structure?

section1:
field1: value
field2: value

section2:
field1:value
field2:value

 

Thanks again!

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2024

You cannot use the API to create requests that has a form attached to it. Form does have an API, but it does not allow you to create a new form and add responses to it.

Regarding the structure of the form you could add the yes/no question to each section, or you could have a single drop-down for the user to select the number of passengers, and based on that you activate each section, something like this:

Screenshot 2024-01-16 at 9.29.48 AM.png

The first section would always be visible, and the following sections would conditionally visible based on the number of passengers selected above 1.

Like Sharon Comery likes this
Sharon Comery
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 4, 2024

This was helpful for me, thank you :)

I added the sections as per your screen shots and in each section I put incremental tables which showed 1, 2, 3 etc rows depending on the number chosen in the conditional field.Conditional tables.JPG

A 3 rowed table shows because 3 was selected in the previous field.

Conditional table 2.JPG

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events