# 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:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![csmu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/csmu/32/2289_2.png) [@csmu](https://community.taiga.io/u/csmu)\
**Post date:** [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/1 "2025-03-31T06:47:16Z")

</div>

Each time I create an epic, user story, task or an issue I start the sequence, press the create button, then

1. Wait for it to be created
2. Copy the id from the url
3. Edit the title
4. Paste the id at the front of the title
5. Save the element.

I do this to make it easy to link the element across different apps for my time keeping - [toggl](https://toggl.com/) and [team task management](https://ticktick.com).

What would I have to change to automatically add the id as a prefix to the title when an elment is created?

---

<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:** [March 31, 2025, 11:31am UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921/2 "2025-03-31T11:31:29Z")

</div>

Hi there!

There is no setting to do so. You could probably tinker something with the API and webhooks so that it autoupdates the name after creation.

On the other hand, if you are talking about the numerical id that appears on every item (as in `#53`), they are sequential so you should be able to guess them beforehand, depending on the number of items and how many people are working on the given project.

Best!

---

<div class="post-metadata">

**Author:** ![csmu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/csmu/32/2289_2.png) [@csmu](https://community.taiga.io/u/csmu)\
**Post date:** [April 1, 2025, 4:49am UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921/3 "2025-04-01T04:49:58Z")

</div>

G’day Charlie

I know there is no setting to do this.

I have no problem with coding on the backend with Django.

I’m looking for where/what I’d have to change in the Taiga/Django backend to do this.

Cheers and thanks!

Keith

---

<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:** [April 2, 2025, 7:02am UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921/4 "2025-04-02T07:02:14Z")

</div>

Hello there, Keith!

You could, for example, add a check in the save method ([here it is for user stories](https://github.com/taigaio/taiga-back/blob/7816bff321406f347264416e7fbfd55086f51b50/taiga/projects/userstories/models.py#L154)). That executes every time an object is created or updated, so it’s best to have something like `if not self.ref in self.subject` or something like that to check before.

Of course, there are other ways to do it, like creating a service [for example](https://github.com/taigaio/taiga-back/blob/7816bff321406f347264416e7fbfd55086f51b50/taiga/projects/userstories/services.py), and then calling it somewhere else in the code.

Hope this helps!

Best!

---

<div class="post-metadata">

**Author:** ![csmu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/csmu/32/2289_2.png) [@csmu](https://community.taiga.io/u/csmu)\
**Post date:** [January 6, 2026, 12:38pm UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921/5 "2026-01-06T12:38:24Z")

</div>

G’day @Charlie

I tried

```auto
def save(self, *args, **kwargs):
    if not self.ref in self.subject:
        self.subject = self.ref + self.subject
    
    if not self.\_importing or not self.modified_date:
        self.modified_date = timezone.now()

    if not self.status_id:
        self.status = self.project.default_issue_status

    if not self.type_id:
        self.type = self.project.default_issue_type

    if not self.severity_id:
        self.severity = self.project.default_severity

    if not self.priority_id:
        self.priority = self.project.default_priority

    return super().save(\*args, \*\*kwargs)

```

```python

and

```

```auto
def save(self, *args, **kwargs):
    if not self.ref in self.subject:
        self.subject = f’{self.ref} {self.subject}’
    
    if not self.\_importing or not self.modified_date:
        self.modified_date = timezone.now()

    if not self.status_id:
        self.status = self.project.default_issue_status

    if not self.type_id:
        self.type = self.project.default_issue_type

    if not self.severity_id:
        self.severity = self.project.default_severity

    if not self.priority_id:
        self.priority = self.project.default_priority

    return super().save(\*args, \*\*kwargs)

```

which caused updating and creation to fail.

The changes I made looks like standard python/Django to me.

Any ideas as to what I’m doing wrong?

---

<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!

---

<div class="post-metadata">

**Author:** ![csmu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/csmu/32/2289_2.png) [@csmu](https://community.taiga.io/u/csmu)\
**Post date:** [February 23, 2026, 9:31pm UTC](https://community.taiga.io/t/adding-the-id-as-a-prefix-of-the-title-of-a-created-elements/6921/8 "2026-02-23T21:31:09Z")

</div>

I’ve implemented this change in

`/taiga-back/taiga/projects/references/models.py`

it works well.

thank you @Charlie cheers!
