Requirement fields for transition issue

Hi everyone,

I’m using the Jira Python API and trying to transition_issue() method. Before doing this transition, I call:
jira.transitions(issue_key,expand='transitions.fields')

This shows that only the resolution fields is marked as required: true for the transition (e.g ‘close’ status)

However, when I perform the transtion without a comment, it fails with the error message: “Comment is required”.
This is confusing because the API metadata does not indicate that comment is required. But UI does enforce it( probably via a validator or screen configuration).

My question is:
Is there any supported or recommended way to detect that comment is required before attempting the transition via REST API?

It seems that some field requirements are hidden from the API and only enforced at runtime. What is the best way to handle this?

Thanks in advance!