Missed Team ’24? Catch up on announcements here.

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

How to access the form data in Jira Automations

Ryan Wolfe June 8, 2022

Previously when the forms were under ProForma, you were able to see the JSON file and reference form data in automations. To see what I am talking about, go to and go to the section called "Access the contents of ProForma Forms" : https://docs.thinktilt.com/proforma/Jira-Automation-(Cloud).1571291510.html

It said it wasn't supported directly and they were working on a solution but here is an excerpt from the article:


Automation for Jira can access the raw ProForma form data (standard forms only) stored in the entity properties of Jira issues and use that data in automation rules. For issues with ProForma forms attached, this means that form field data and form state can be read by Automation for Jira directly.

The structure to access data, where AAA is the question ID number (not the Question Key defined in the form builder) is:

  • Text/Email/URL/Number Fields: {{issue.properties."proforma.forms.i1".state.answers.AAA.text}}

  • Date Fields: {{issue.properties."proforma.forms.i1".state.answers.AAA.date}}

  • Time Fields: {{issue.properties."proforma.forms.i1".state.answers.AAA.time}}

  • Name of a user: {{issue.properties."proforma.forms.i1".state.answers.AAA.users.get(0).name}}

  • Choice Fields: {{issue.properties."proforma.forms.i1".state.answers.AAA.choices.get(0)}}

    • Note this will only return the ID associated with the choice rather than the text.

    • The text of the selected choice value is stored is difficult for Automation for Jira to retrieve. It is stored as:
      issue.properties."proforma.forms.i1".questions.choices

To find the question ID, go to the Preview tab of the standard form builder and enter values in the desired fields so they are populated. Then go to the Issue JSON tab and scroll down to the state array at the bottom.


All automations that were set up previously with these property calls are still working but the JSON view has been taken away, so I am not able to find the field properties to access the data. 

This is a requirement because we are gathering a lot of information that is just for getting a task done and we need it broken out in separate fields to ensure people fill them out correctly, but when passed over to the teams that will work them, we only need it all dumped into a Description field so they can see it. 

Basically, is there any way now that it has been integrated, to find this information so that we can continue to utilize the forms as we did before?

4 answers

1 accepted

6 votes
Answer accepted
Simon H
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.
June 15, 2022

@Ryan Wolfe thanks for your question. As noted there is no formal support for accessing the form entity property directly; however, the data is still there and you can use the steps above to access it.

We will bring support to Automation for Jira to access form contents with SmartValues; however, it is not yet available.

In the meantime you can use the Entity Property Tool for Jira to be able to inspect the form data. This should allow you to continue to build your automations.

Again, this work is not officially supported, so please be careful how you work with these properties as you can easily break a form by changing the JSON.

A few screenshots to show you how to access the data.

SCR-20220616-dyo.png

SCR-20220616-dzl.png

Ryan Wolfe June 16, 2022

@Simon H Thank you for the suggestion. I am definitely looking forward to a more official solution but this will definitely work in the meantime. 

Like # people like this
Amanda Ward August 8, 2022

@Simon H - Great information. Any updates on this? I can't imagine how this wouldn't be the primary focus of the Forms being migrated to Jira from Proforma. Why would anyone not be able to pull some of the data linked to data connections into Jira. I don't see a use case where at least something should be brought into a Jira field. 

Like # people like this
Ryan Wolfe August 8, 2022

we have some very large and completed intake forms that teams need a lot of different information that is very similar but different and we need to pass the information to different teams using automations. If we were forced to make a Jira System Field for everyone it would easily increase our system fields by double if not a lot more.

For example, you might just want an address in a single text field but you also want it standardized into some sort of format. The easiest way is to use forms to break it up into its components and then reassemble them into a single address in the field after. We have need of this many, many times.

@Amanda Ward for your question about not having data in a Jira System Field, we do often use the form to gather the information that we do not need in Jira directly. For Example, you just need some basic information about a task but you will never use it for automation, reporting, or any other part of Jira; you can then just put it in the form and not create extra Jira Tasks (although if you could just add it to the description, that would be excellent too). 

Another instance is asking questions to perform logic in the form that we do not want to move into Jira. I use this a lot to hide sections with required form fields that are only needed in very specific situations or make a warning appear when people keep making errors to try to get them to stop and pay attention.

Like # people like this
Amanda Ward August 8, 2022

@Ryan Wolfe - Yeah i totally get not putting some of the form fields in as Jira Fields, but I mean a scenario where at least 1 field wouldn't be needed. Just find it hard to imagine. For my particular setup, we are doing consultant status reports because not all projects are in our Jira because they are maintained on our client systems. So, for me, I tried using Jira Work Management, but the Data Connection option wasn't even available. So, I thought let me try Service Management instead. As a result, I have staff create a quick status report, but in order for us to be able aggregate the reports and use them effectively, I want them to be able to select a Client Project Name from a Data Connection, but then I can't copy it or anything else over into Jira for it to be used for aggregates. Hopefully that helps explain my current Use Case. I know our Service Desk also has things they would like to pull into Jira from the form, but they haven't been able to get a workaround either, which is why I was curious as to the timeline. 

 

Thanks!

Like Sanjog Sigdel likes this
Amanda Ward August 8, 2022

@Ryan Wolfe - If I created a form after Jira migrated to Jira Forms, do you know if this workaround will work for me as well as any forms previously created before the acquisition?

Like Sanjog Sigdel likes this
Ryan Wolfe August 8, 2022

@Amanda Ward Yes you can still do this, you just have to do some extra work to locate the numbers that you would use to do the smart value codes. You could use the option above or I used inspect on my browser and basically narrowed it down to the bit of code that displays the form field and located the number in there. 

Long story short, it isn't as easy as it was to set it up, but it does work. 

Like Amanda Ward likes this
Amanda Ward August 8, 2022

@Ryan Wolfe -- You rock. I figured it out with the Inspect element. Thanks so much. Thats a HUGE relief and help!

Like Kalin U likes this
Adam England August 9, 2022

@Ryan Wolfe @Amanda Ward 

Do you have a cheat sheet to inspect the element on the dev tab on browser?  I added the entity tool but don't want the rest of our team poking around with the json so prefer the hidden option :)

Where can I extract the ID for the questions?  TIA

Like Michael.Gaskin likes this
Amanda Ward August 9, 2022

@Adam England - All I did was open one of the Jira Issues that had the Jira fields up top and the form fields at the bottom and then right clicked on the form field and clicked "Inspect" in the right click menu options. Expand the div out and you will see the "container id." The number at the end is the "AAA" from above. 

image.png

 

Hope that helps. 

Like # people like this
Adam England August 9, 2022

Fantastic, thank you so much!

pedjaM April 6, 2023

@Simon H any idea when this feature is coming to Jira Cloud?

Talking about this:

"We will bring support to Automation for Jira to access form contents with SmartValues; however, it is not yet available."

Like # people like this
Pablo Marín Asensio July 12, 2023

Hello @Simon Herd , any updates on when we can expect this to be live for Jira Cloud?

DamCoder
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.
July 24, 2023

This is the smart value from my form:

 

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

 

It does return a value when I set the condition to contains instead of equals.

Screen Shot 2023-07-24 at 3.50.10 PM.png

I found another community article that changed out the pf-1-cd-2 id for just 2 as in my updated example above.

My automation is now working great!

 

Like # people like this
Silas Forkel March 22, 2024

Great Job!!!
This answer article and answers helped us a lot!!

BR
Silas

1 vote
Christian Schneider
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.
July 7, 2023

Hi,

I am having a similar issue. I have a form with some integers, I would like to use in a post-function in a workflow.

I am using the JMWE-App for a lot of post functions. The nunjucks to read the forms-values is:

{{ issue | issueProperty("proforma.forms.i1") | dump(2) }}


e.g.:
{% set json = issue | issueProperty("proforma.forms.i1") %}
{{ json.state.answers['51'].text }}

 From there, you can read any value from the forms.

 

Do Automations allow Nunjucks?

 

Chris

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2023

Hi @Chris Schneider ,

No, Jira Automation doesn't support Nunjucks, only JMWE does.

1 vote
Terence Ng September 7, 2022

Hi,

Based on this tag, in order to get value:

<input id="pf-2-ts-228" data-ds--text-field--input="true" class="css-wxvfrp" value="xyz"> 

 

I should use {{issue.properties."proforma.forms.i1".state.answers.228.text}} ? Is this correct?

Terence Ng September 7, 2022

I managed to resolve,  it is supposed to be i2 instead of i1

Like Sanjog Sigdel likes this
0 votes
Stephan Hannach November 3, 2023

Here, the Forms API is documented: 

https://developer.atlassian.com/cloud/forms/rest/

Suggest an answer

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

Atlassian Community Events