Getting Text of ProForma Multiple Choice Values via Jira Automation

Andrew K_ August 26, 2022

Hello Community,

We are using ProForma to create forms. I am attempting to use Jira Automation to populate the description field of a Jira issue with a number of ProForma form field values. I can get the text values for everything other than multiple choice. 

In referencing the documentation here, https://docs.thinktilt.com/proforma/automation-for-jira-server, it says the text is stored as 

issue.properties."proforma.forms.i1".questions.choices

However, try as I might, I cannot figure out the proper structure to access the text values that were selected.

For example, I've tried this where 2 is the confirmed question ID: {{issue.properties."proforma.forms.i1".questions.choices.2.choices.get(0)}}

and 


{{issue.properties."proforma.forms.i1".state.answers.2.questions.choices.get(0)}}

and many others. 

Any tips?

3 answers

1 accepted

0 votes
Answer accepted
Andrew K_ October 5, 2022

After digging into this and contacting Atlassian support here's what I've learned. 

You cannot get the text value or question label from a submitted choice(s) (radio or checkbox) using Jira automation. You can get the answer id or ids of the submitted choice(s) because that's what's being passed via a JSON array.

Interestingly, the form obviously contains the question and you can get the label value of the question manually.

Let me try to explain with an example. 

Question 1:
Do you like the color blue?
Yes
No

If you try to write a Jira automation to update your description using 
{{issue.properties."proforma.forms.i1".state.answers.1.choices.get(0)}}

What will be updated in the description field will be a 1 or 2. Not, Yes or No. In our example 1 = Yes and 2 = No. If you use a check boxes with multiple choices, the numbers increase by one for every additional choice. 

Interestingly, you can manually get the label of a questions choices using
{{issue.properties."proforma.forms.i1".design.questions.6.choices.get(1).label}}
{{issue.properties."proforma.forms.i1".design.questions.6.choices.get(2).label}}

These would return Yes and No. But you are manually hardcoding the 1 and 2 and it would not be based on the submitted choice. It's basically returning the answer key and will always return the label of the question's choice no matter if it was submitted or not. 

You also cannot nest things either and try to do something like
{{issue.properties."proforma.forms.i1".design.questions.1.choices.get(issue.properties."proforma.forms.i1".state.answers.1.choices.get(0)).label}

So even though Jira can access the question label directly, and there is a direct mapping between questions/labels and state/answers because you can manually look things up, there doesn't seem to be a lookup than can happen automatically for a Jira automation to resolve choice type question answers (1 or 2) to labels (Yes or No). If this is statement is wrong, I'd love to be correct. 

Your only current solution would be to create a custom Jira field with the same answer options you need as the ProForma smart field and then map the field in the form to the Jira custom form. You'll have to do this for every choice type question/field you have as they need to be unique. 

shuguo qin May 24, 2024

works like charm.

 

{{issue.properties."proforma.forms.i1".design.questions.1.choices.get(issue.properties."proforma.forms.i1".state.answers.1.choices.get(0)).label}

issue.properties."proforma.forms.i1".state.answers.1.choices.get(0) should minus 1

 

becouse issue.properties."proforma.forms.i1".state.answers.1.choices.get(0) starts from 1

and issue.properties."proforma.forms.i1".design.questions.1.choices as arraylist start from 0

2 votes
Gleiciany Alves Cardoso October 23, 2023
Hey, @Andrew K_ 
 
I found a solution using Assets + Jira Automation to copy the information (text) from the forms. I wrote an article about it here!
 
I hope it helps! :)
0 votes
Bill Sheboy
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.
August 27, 2022

Hi @Andrew K_ 

First thing, a disclaimer I am using Jira Cloud and am not using ProForma.  With that out of the way...

Looking at that documentation, there are a few warnings and disclaimers about what is not supported yet.  As you are probably paying for this tool perhaps submit a support ticket to the vendor to see what they say.

While waiting for an answer, I recommend starting from the simplest example from the vendor documentation, writing the results to the audit log, and incrementally drilling down to find the data.  For example, try this to see how many values are in that choices field selected:

{{issue.properties."proforma.forms.i1".questions.choices.size|0}}

And depending upon how they implemented the addon, you may be able to identify the correct smart values/path to use with this how-to article from Atlassian:

https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

That same documentation page also describes how to use the preview of their forms builder to learn the JSON structure.

Kind regards,
Bill

Andrew K_ August 27, 2022

Hey @Bill Sheboy , thanks for the reply.

I've been able to successfully write to the audit log and look into the JSON. In the JSON the text value is not something that exists. Just the numerical value of the choice along with the question id. I assume that's why the disclaimer are present and states "The text of the selected choice value is stored is difficult for Automation for Jira to retrieve".

However, the documentation also declares the text of the value is stored as a specific entity property with a structure. It seems like others have figured it out somehow researching other posts. But solutions aren't posted except for one that I found which was years old and doesn't seem to work anymore.  

Maybe it's a Schrödinger property, haha. It both exists and doesn't at the same time. 

Bill Sheboy
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.
August 27, 2022

Ha!

If you found an old post indicating someone figured this out, I recommend replying to that post and ask for more info from the person.

And as the vendor states it is possible/difficult, it seems reasonable you could ask them for an example by their support channel...if you are on the paid license.

YY Brother
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2023

@Bill Sheboy  I can contact proForma team guys to ask for any sugggestion to get the choice value through jira automaiton and will let you know if I get the expected result.

Like Sven Kr likes this
Michele Cocca
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!
April 21, 2023

@YY Brother any news from proForma?

Like Sven Kr likes this
YY Brother
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2023

not yet

Like Michele Cocca likes this
Giuseppe Giovinazzo
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!
August 30, 2023

Any update on how to retrieve the text of the dropdown from a proforma?

I am able of getting the position of the selected element with: 

{{issue.properties."proforma.forms.i1".state.answers.1.choices.get(0)}}

but cannot retrieve the text of the first element

{{issue.properties."proforma.forms.i1".state.answers.1.choices.get(1).label}}

nor

{{issue.properties."proforma.forms.i1".state.answers.1.choices.get(1).text}}

Like Gleiciany Alves Cardoso likes this
Bill Sheboy
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.
August 31, 2023

Hi @Giuseppe Giovinazzo -- Welcome to the Atlassian Community!

As this thread is from several months ago, you may want to work with your site admin to contact proForma's support team to learn what they say.

Kind regards,
Bill

Giuseppe Giovinazzo
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 1, 2023

Can you please share how to contact with them? Thanks

Gleiciany Alves Cardoso October 23, 2023
 
I found a solution using Assets + Jira Automation to copy the information (text) from the forms. I wrote an article about it here!
 
I hope it helps! :)
Like Josh likes this

Suggest an answer

Log in or Sign up to answer