Jira Cloud has added a great deal of flexibility and usability in recent years with the addition of Forms and Assets. Since then, those features have enjoyed continued integration into the Cloud platform, including dedicated Automation Components. However, even with these improvements, getting from Point A to Point B is not always straightforward. This post will outline how to use Automation to create an Asset from data submitted using a Form.
Form and Asset Configuration
It is worth mentioning that the questions on the Form do not have to be a 1:1 representation of the Attribute values used to create the Asset. Form values can be modified or ignored entirely, and attribute values can be provided statically within the Automation Rule. A bit of planning is still in order though.
Examples:
- if an Attribute uses a select list, ensure that all options presented on the Form are valid during Asset creation
- ensure any required Attribute values are accounted for in the Automation Rule in order to avoid errors
While configuring and testing the Rule, it can be helpful to build one step and a time while making use of the Log Action component to check values.
Capturing Form Data in Automation
The Web Request component is used multiple times in order to capture the data provided on the Form, using the Forms REST API.
Requirements:
- Finding your Cloud ID
- In my testing, I had to enter the Cloud ID directly in the Web Request URL.
- Access Token
Retrieving the Form ID
The Get Form Index resource provides details regarding the Forms attached to the provided Issue.
Note: This example assumes that only one Form is attached to the Issue during this operation. If multiple Forms are attached, it would be necessary to iterate over the Forms data to identify the desired ID value.
Retrieving the Form Answers
The Get Form Simplified Answers resource provides a user friendly means for accessing the Form data. Storing the answers in a variable adds clarity to the following steps of the process.
Using a Lookup Table
If there is a large number of answers to process, consider using the Create Lookup Table component to provide additional clarity going forward. This allows you to define Keys for each answer. Individual Values can be captured by using a smart value to iterate over the formData variable created in the last step.
- Example - this smart value would capture the answer provided to a Form Field named "Training Event Name"
-
{
-
Sign up to receive more great content
Learn more about Atlassian and how Isos can help by signing up to receive our latest blogs, eBooks, whitepapers and more.