Enable users to specify custom titles based on certain fields

It depends on the situation. For example, this is not recommended:
    ID = 'id'
    task_id = task[ID]

However, there are many cases where it is good to put strings into constants, such as:
    RE_TASK_ID_LOCATOR = r'SDE T(\d)+: \s+'
    ...
    re.search(RE_TASK_ID_LOCATOR)

It looks odd the way you have done it as it looks more like the first case. There are good reasons for doing the fist cases regardless of how odd it looks, for example when you might expect to later modify that in your next version of the code (so that you avoid updating 20 difference places in the code).