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

Conditional questions that use the same Jira field- possible?

pamela_wagner March 15, 2022

Hi
Currently using Proforma Lite until we move to cloud (who knows when), I'm trying to set up a form that has a condition where depending on the answer the default in the linked Description field is different.
Even though I've separated my conditional section, the second one tells me that I can't use the linked field because it's already in use.

suggestions on how to proceed?

 

Thanks,
Pam

3 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Mike Rathwell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 15, 2022

Hi @pamela_wagner 

That is a Thing and one that I often find problematic myself where a given linked field can only appear on my developed form once even though I might have multiple conditional sections that could use that field while still only having it appear once during information capture.

The only way I have managed to get around it is very careful planning of both conditional questions and what order they are asked so I can build the form as I go and as answers are asked. I can also get around some of it by using conditional questions are are NOT Jira fields.

I wish I had a better answer but I do feel your pain there.

pamela_wagner March 16, 2022

Thanks,  Ths is a big bummer and seems odd.  No matter the answers, I need to fill out the Summary/Title field in my Jira issue. 
Can you give an example of how you've worked around this?
Here's my basic example.
Question 1-
   Single option choose A or B

Map answer to Summary field- the difference being the default entry

Question 2-
  Single choice allowed between A, B, C

Map answer to Description field- again, the difference only being the default text.

Greatly appreciate any options you provide!  Thanks. 

Mike Rathwell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2022

So... THAT one, @pamela_wagner , I typically solve with Automation. It would take the form (no pun intended) of:

  • Trigger on issue create
  • Look at choice field values (which currently have to be Jira Issue Fields at this point)
  • Set the other values from the choices.

Note that you may need to induce delays in the automation. Because All the Things are asynchronous in Jira Cloud, there is no guarantee that values have settled when a trigger occurs. ProForma, itself, can take some time to populate defaults if, for example, you have Summary set as a hidden field to be populated by ProForma. The issue creates with the default text to get the create to happen in the first place and shortly thereafter updates to what was placed in the form. Triggering on field values set in ProForma may NOT have been committed when the automation triggers. 

It is also possible to trigger of field change rather than issue create to capture that. 

Trial and many, many errors are the watchwords here.

Like Peter Preston likes this
0 votes
Marc Koppelaar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 17, 2022

Hi,

Other options can be to have multiple pieces of information provided by the form copied all into a paragraph field like description.

This will require an app like Scriptrunner, JMWE or PowerScript.

You are able to make a Data Dump of you complete Proforma Form.

There is a default script for this.

https://thinktilt.atlassian.net/wiki/spaces/PFDEV/pages/1588527144/Data+Dump

This is the script for Cloud.

This does not work with JMWE, as they don't use Groovy in Cloud, but Nunjucks.

I have made my own version for this, so if you use JMWE, this might help you out.

{%set proformaForm = issue | issueProperty("proforma.forms.i1") %}
{%set answers = proformaForm.state.answers%}

{#Extracting the Choice ID and storing it in choiceID variable #}
{%set choiceID1=answers[1].choices|string%}

{%if answers[5].choices%}
{%set choiceID5=answers[5].choices|string%}
{%endif%}

{#Handling multiple users (Members), extracting their IDs from forms and storing their name into multiUsers array#}
{% set multiUsers = [] %}
{%for user in answers[2].users%}
{%set ignored = multiUsers1.push(user.id|userInfo ( "displayName" ))%}
{% endfor %}


{#Extracting and displaying Choice's label#}
Requirement: {{proformaForm.design.questions[1].choices|find(["id",choiceID1])|field("label")}}

Name: {{answers[3].text}}

{#Extracting and displaying user's name from Single User field#}
Administrator: {{answers[4].users|first|field("id")|userInfo ("displayName")}}

{#Displaying the array of usernames#}
Members: {{multiUsers}}

Choice Field 2: {{proformaForm.design.questions[5].choices|find(["id",choiceID5])|field("label")}}

Source: {{answers[6].text}}

Date: {{answers[7].date}}

The number between [], represents the answers id on the form. Find these by previewing a from and then select the Issue JSON.

These id's with your input will be found at the bottom of the JSON.

I hope this will help some members

Cheers,

Marc

0 votes
Peter Preston
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 15, 2022

Hi @pamela_wagner 👋 -- thanks for sharing this. We've heard this a few times and I have to agree with @Mike Rathwell that the best workaround is to carefully plan your questions as best you can. Even then you may run into the issue of linking one form field to one Jira field. Also like Mike, wish I had a better answer for you too.

Tagging @Simon Herd here for product team awareness. 

TAGS
AUG Leaders

Atlassian Community Events