# Adding the id as a prefix of the title of a created elements

**URL:** <https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921>\
**Category:** Self hosted Taiga\
**Created:** [March 31, 2025, 6:47am UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921 "2025-03-31T06:47:16Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Charlie](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@Charlie](https://community.taiga.io/u/Charlie)\
**Post date:** [January 7, 2026, 9:18am UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921/6 "2026-01-07T09:18:37Z")

</div>

Hi there, Keith!

I checked the code again just in case, and the ref value is auto generated in a post save signal (so it is not available before the save). You can either do it after the save, or globally on [this method](https://github.com/taigaio/taiga-back/blob/f1d8141b45af98fdd1f0824d82113f0be477f6b1/taiga/projects/references/models.py#L101), something like this:

```auto
// ...existing code...
def attach_sequence(sender, instance, created, **kwargs):
    if not instance._importing:
        if created or instance.prev_project != instance.project:
            # Create a reference object. This operation should be
            # used in transaction context, otherwise it can
            # create a lot of phantom reference objects.
            refval, _ = make_reference(instance, instance.project)

            # Additionally, attach sequence number to instance as ref
            instance.ref = refval
            
            # Add ref prefix to subject if not already present
            if hasattr(instance, 'subject') and not instance.subject.startswith(f"{refval} "):
                instance.subject = f"{refval} {instance.subject}"
                instance.save(update_fields=['ref', 'subject'])
            else:
                instance.save(update_fields=['ref'])

```

That would affect all instance types, though: Issue, Task, Epic and User Story. I did a quick try and it seems to work, let me know if that works for you.

Best!

---

_[View the full topic](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921)._
