This function automatically generates a unique case number for each new post in the “sager” (cases) post type and stores it as metadata.