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
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
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.