Incremental IDs (JIRA style)

Is there a simple way to implement a ID system similar to JIRA? example will be something like “ABC-001” for process 1. “DEF-001” for process 2.

The number portion will increment every time a new process instance is created. And then one step further for task of that instance, “ABC-TASK-001”

Wondering if there is a simple way to implement this or if anyone here has done something similar.