Well got a lot further wth this.
1). Export endpoints file
2). just as a check try and import it again
problem is that here it fails.
If you've got endpoint entries that existed before you added the custom mandatory attribute was created then when you export endpoints, they don't include the custom mandatory attribute ( one shown below with it included). This means when you try and import the file again it fails for every entry that doesn't have the custom attribute present in the file
<Endpoint macVendor="Apple, Inc." macAddress="38c98631d4bc" status="Known">
<EndpointProfile updatedAt="Jun 28, 2018 07:52:56 BST" addedAt="Jan 19, 2016 16:04:21 GMT" fingerprint="{"dhcp": {"option55": ["1,121,3,6,15,119,252,95,44,46"], "options": ["53,55,57,61,50,54,12,82"]}}" conflict="false" name="Mac OS X" family="Apple Mac" category="Computer" hostname="admins-mac-mini" staticIP="false" ipAddress="144.32.226.150"/>
<EndpointTags tagName="UoY_Vlan" tagValue="226"/>
<EndpointTags tagName="UoYDevice" tagValue="true"/>
<EndpointTags tagName="UoY_Airgroup_User_Device" tagValue="false"/>
<EndpointTags tagName="UoY_Airgroup_Shared_Server_Device" tagValue="false"/>
</Endpoint>
3). In endpoints you . can search for every endpoint entry with a particular attribute present. In our case there were only 44 of them and non of them were using it for anything. Delete the endpopints
4). You can now edit the custom attribute and change it from mandatory to optional
5). Try to delete attribute and you might find that its used somewhere in a policy
6). Find policies that use it and edit/delete/replace accordingly
7). Delete attribute from custom list
Simples!
Points to note however
1). Depending on how often you refresh your endpoints db you might . have loads of entries with this custom variable set, in which case this procedure will probalby not be the right thing to do.
2). Still trying to decide whether its a bug where you cannot export and import an endpoints db because all the exported entries don't any mandatroy attributes. Perhaps there should be an "override" button