How to distinguish between single-line and multi-line text fields? Both fields return a “string” data type.
Hello @TomaszKlin
Are you referring to built-in fields or custom fields? Via which REST API endpoint?
Both built-in and custom. I used GET
/rest/api/3/field?expand=projects.issuetypes.fields endpoint.
I noticed that for custom fields if {Field}.Schema.Custom is equal to “com.atlassian.jira.plugin.system.customfieldtypes:textarea” than fields is multiline (ADF).
Yep, that’s it exactly.
It’s the reciprocal of the v3 Create custom field endpoint where you use the type parameter to define the text field type as either:
textarea
: Stores a long text string using a multiline text area
(value:com.atlassian.jira.plugin.system.customfieldtypes:textarea
)textfield
: Stores a text string using a single-line text box
(value:com.atlassian.jira.plugin.system.customfieldtypes:textfield
)
You’ve probably already noticed that there is no equivalent for the built-in text fields. This is probably because this information is easily found via the GUI, and those default text fields are always the same, so you always know which few are the textarea types, and the rest, by exclusion, must be textfield types.