We are currently masking a lot of fields in our form and only a few are on a create screen for new Stories reported by a customer.
We are using a code similar to my snippet, but I wonder if there is a way to hide all fields on the screen and then enable only some. It would be definitely easier to maintain.
Snippet from our template:
def fieldNamesToHide = ['A', 'B', 'C', 'D']
for (fieldName in fieldNamesToHide) {
def field = getFieldByName(fieldName)
field.setHidden(true)
}