Deprecation Notice: Removing access to Forms data using Jira entity properties API
To access forms properties after the deprecation, it will be necessary to use the new feature for Forms smart-values:
Alternatively, you can access these properties via the Jira Forms REST API. Here is a general guide on how you can access these properties:
https://api.atlassian.com/jira/forms/cloud/{cloudId}/project/{projectIdOrKey}/form
This will return all the forms from your project, allowing you to find the formTemplate ID for each of them:https://api.atlassian.com/jira/forms/cloud/{cloudId}/project/{projectIdOrKey}/form/{formTemplateId}
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form
This will return all the forms from an issue, allowing you to find the form ID for each of them:https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}
This workaround is meant to help customers who were used to working with the JSON tab provided by ThinkTilt (Proforma) and which is now being modified to use in Jira Forms. And also, to help new Forms customers to be able to get the forms fields ID.
As this feature is being changed and probably will bring support to Automation for Jira to access form contents with SmartValues. 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 automation, for example.
Note: This tool 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.
Therefore, if you don’t want to use the Entity Property Tool for Jira and prefer to use the Proforma API, you can access the structure using the API link below:
https://<yourCloudURL>.atlassian.net/rest/api/2/issue/<issue-id>/properties/proforma.forms.i1
Tip: The "i1" is the number of the form attached to the ticket. So if you have 3 forms attached and want to access the second, it will need to use "i2".
Important related documentation:
Use forms in Jira Service Management
How AFJ works
Smart values
Work has already started on the new Forms API functionality and we now have some experimental APIs available for use. So now Marketplace Partners can already integrate forms into their products.
For more information, please refer to the features below:
Note: Forms API are now available and documentation is available here. We are continuing to work on the functionality available which is why this issue remains In Progress.
With the Entity Property Tool for Jira installed you only will need to add the form, that you desire to get the IDs, in a ticket and go into the Entity properties tab, as I show in the screenshot below:
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}}
ID of a user: {{issue.properties."proforma.forms.i1".state.answers.AAA.users.get(0).id}}
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
About the Choice Fields property limitation, we do have an item in our development backlog aimed at improving this as well:
So, on the Entity property box, you will see: "proforma.forms.i1", "proforma.forms.i2"(it will probably be "1", which is a reference to the first form in the list, if it is the second form, it will be "2" then "3" and so on...):
Using a code editor like Sublime you can paste the form properties and look for the fields that you desire and get the IDs, as I show on the screen recording below:
Bruno Altenhofen
Atlassian Engineer - The guy from Proforma(Jira Forms)
e-Core
Krakow - Poland
1 accepted answer
17 comments