I have a very long form in Jira, whose fields are used in a variety of automations or API calls. Because of this, I often need to get the id of a specific field in the forms, but, as far as I know, the only way to do this, is to call this specific API:
https://api.atlassian.com/jira/forms/cloud/{{CloudID}}/project/{{ProjectKey}}/form/{{FormID}}
Doing this and then logging {{webResponse.body.design.questions}} gets me the list of fields and their respective information, like this:
{381={choices=[], description=, label=New annual membership fee, questionKey=NewAnnualFee, type=tl, validation={rq=false}}
The number at the beginning, in this case, 381, is the one I need. The problem is, because the form is so long, the response doesn't fit in Jira's log response, so I often can't see the info of the exact field that I need.
I imagine there must be a way to log just the info for the field with a specific label or questionKey, but I'm having trouble making it happen.
I've tried doing
{{#if(equals(questionKey. XXX))}}{{webResponse.body.design.questions}}{{/}}
but that just returns the whole thing again
Hi @C0666379
I think the tricky part here is that you’re having to work with the internal ID of a Jira Forms question, rather than with a stable field identifier.
If you’re open to an app-based approach, Smart Forms for Jira is developed by my team at SaaSJet, and we handle this a little differently.
Smart Forms has a Form Responses Data Source API that returns responses as structured JSON. Each submitted answer includes its own form element ID/key, field type, label, and value, so you can address a particular field directly rather than retrieving a very large form definition and searching for a numeric ID such as 381.
For example, an answer is returned conceptually as:
{
"id": "SLI-1",
"type": "text",
"label": "Request title",
"value": "..."
}
The same response structure also includes the Jira work item connected to the submission, and attachment responses include links to the uploaded files. The API can be called from Jira Automation, so you can retrieve the response and use the required value later in the same automation flow.
For attachments specifically, Smart Forms also stores uploaded files on the Jira work item. So depending on what you need to do afterwards, you can either:
identify the attachment field through the Data Source API → get its attachment data, or work with the resulting Jira issue attachment directly.
It doesn’t expose or resolve the internal numeric IDs of an existing native Jira Form, so it wouldn’t fix that particular API call in place. But if this lookup is something you have to do frequently, it removes the need to depend on those internal question IDs in the first place.
Hi @C0666379
If you have given this option in the form a Field Key, this should be possible, if the form is attached to an issue.
{{forms.last.<name_of_the_field_key>}}
Form smart values -> access-smart-values-for-forms-and-form-fields
Also this API call might give you the options you need, https://developer.atlassian.com/cloud/forms/rest/api-group-forms-on-customer-request/#api-request-issueidorkey-form-formid-format-answers-get
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem is, the field key doesn't work for attachment fields, which are the ones I need. In order to get attachment, I need the actual ID of the field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you considered using something like Postman to get the field Id? The log action in Automations is limited in output, so I have used Postman to get the full output when needed. The flow will have access to the full response, you just can't output it to the audit log.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.