The required properties depend on the type of the custom field. Only task templates which are linked to a project template are allowed to have custom fields set.
project-manage-config:write
permissions.The id of the task template to set the custom fields for.