FLS not committed for some specific fields.

When moving Profiles or Permission Sets, either with the normal commit or with the Full Profile and Permission Sets commit, you may notice that the FLS for some fields is not committed into Git.

Whenever that happens, check if the fields are Required in the source org you are committing from. If the field is set as Required in the field definition, the FLS will not be retrieved by the Metadata API and therefore it will not be committed.

This is the standard behaviour since the API version 30. See page 399 in the document below:

http://resources.docs.salesforce.com/188/latest/en-us/sfdc/pdf/salesforce_spring14_release_notes.pdf


User-added image

If the field is required in the target org, the FLS will be already updated in the Permission Set and Profiles since this happens automatically as soon as the field is set as Required. If the field is not required in the target org, you just need to move the field so that the attribute is updated in the target org and the FLS is updated automatically in the profiles and permissions sets.
 

How did we do?