Working with JSD Forms
The article discusses the challenges and solutions related to integrating Jira forms with iHub apps. It explains how to fetch form data using GET requests, understand the response format, and create child actions to iterate and filter forms based on specific criteria.
Â
Fetching Form Data:
The app uses a GET request to retrieve information about forms on a specific Jira ticket.
To make the request, it uses a special web address (URL) like this:
https://api.atlassian.com/jira/forms/cloud/ID HERE/issue/{{issue.key}}/form
You need to replace
ID HERE
with your unique Atlassian cloud ID. You can find this ID at:https://yoursite.atlassian.net/_edge/tenant_info
The response from the request is a list of forms submitted on that ticket.
Understanding the Response:
The response is a list of "dictionaries" containing details about each form.Each dictionary has information like:
Form ID
Form Name (e.g., "Conference notes")
Whether the form is internal or not
Whether the form is submitted or not
Last updated date
[ { "id": "3aeb06c6-45fd-4b63-a55a-aa56095d7971", "formTemplate": { "id": "89914be6-f8c2-455b-b99d-bbee115c6f86" }, "internal": true, "submitted": true, "lock": false, "name": "Conference notes ", "updated": "2024-09-25T14:06:38.378Z" }, { "id": "d4a35e0a-f9cb-4822-94e9-11bc83da326f", "formTemplate": { "id": "89914be6-f8c2-455b-b99d-bbee115c6f86" }, "internal": true, "submitted": true, "lock": false, "name": "Conference notes ", "updated": "2024-09-26T09:00:28.202Z" } ]
Looping Through Forms (Optional):
If you want to process each form individually, you can create a "child action" within your iHub app.
This child action will use a loop to go through each form in the list one by one.
To access the list of forms in the loop, you can use this code:
$.payload._values
Filtering Forms (Optional) using iHub Conditions:
You can choose to only process specific forms based on their ID.
You can set a condition in your app to only trigger the child action for forms with a specific ID.
For example, you can only process forms with the ID "d4a35e0a-f9cb-4822-94e9-11bc83da326f".
Â
Â