Hi! Unfortunately, we often have cases where someone accidentally deletes an important custom field.
We warn project managers to put blockers on editing important custom fields, but you can’t keep an eye on everyone
My question: How to find out the ID of a deleted custom field? (I know name of custom field, project where this field was used, space id)
As far as I can see from the official documentation, the custom field can be easily restored via the Update a custom field but it required custom_field_gid and I don’t know how to get it
Are these global custom fields, local custom fields, or a mix of both?
Have you considering locking these fields to only one editor (hopefully there will be more permission control for fields soon!)?
Are people deleting the fields, removing them from projects, or a mix of both?
The endpoint you referenced in your post is primarily used to update the settings of existing fields (e.g., the precision of numbers, name of the field, etc.) AFAIK, if a field is deleted, there’s not a great way to recover it via the API, as that GID will theoretically no longer exist in your environment. I believe Asana support can recover this for you if it’s relatively recent.
@Иван_Рязанов - as far as I know, there’s not an easy way to recover a deleted field via API (if it’s just been removed from a project, it’s of course easy to just go and add it back in). If you are an admin of your org, you could do an audit log export with a filter for custom field deleted. This should give you event info about the deletion (including GID, I believe), but I still don’t know how you would restore that field without Asana’s support.