GlideForm - getLabelOf(String fieldName)

Returns the plain text value of the field label.

Table 1. Parameters
Name Type Description
fieldName String The field name
Table 2. Returns
Type Description
String The label text.

if (g_user.hasRole('itil')) {
    var oldLabel = g_form.getLabelOf('comments');
    g_form.setLabelOf('comments', oldLabel + ' (Customer visible)');
}