# Create dynamic Tag Group at topic level?

**URL:** https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584
**Category:** Feature
**Tags:** tags, tag-groups
**Created:** [May 10, 2025, 12:54pm UTC](https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584 "2025-05-10T12:54:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tknospdr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tknospdr/32/529762_2.png) [@tknospdr](https://meta.discourse.org/u/tknospdr)
#### Post date: [May 10, 2025, 12:54pm UTC](https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584/1 "2025-05-10T12:54:40Z")

</div>

I’m building out a ticket system for my company and I’d really like to be able to assign a tag group restricted to my support category only, for company names. But since we don’t know the name of every company we’ll interact with ahead of time, I was wondering if there was a way I could add tags to that group at first interaction with the topic?

Seems like a lot of work to:

1. Get new topic
2. Determine who it’s from
3. If first post from that company,
4. Go to tags page and add name to Tag Group
5. Go back to topic and assign tag

Or maybe there’s a way to dynamically add the new user to a group ‘company\_name’?  
I can’t do it via ‘email domain’ as a lot of our users don’t have company specific e-mail addresses.

Or is there a 3rd way that others do something similar that I might consider?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [May 11, 2025, 1:07am UTC](https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584/2 "2025-05-11T01:07:40Z")

</div>

There is this code I found that can create tags uskng code:

> [@\[API\] Cleaner way to create a tag?](https://meta.discourse.org/t/api-cleaner-way-to-create-a-tag/70526/12):
>
> the undocumented api `/tags/upload.json`, used by the `Upload Tags` menu. Use it like this:
> 
> ```javascript
> const tags = ['tag1', 'tag2']
> const file = new Blob([tags.join('n')], { type: 'text/plain' })
> const formData = new FormData()
> formData.append('file', file)
> $.ajax({
> type: 'POST',
> url: '/tags/upload.json',
> data: formData,
> contentType: false,
> processData: false
> })
> 
> ```

You could make an API call to get the topic’s poster, which will be the company’s name.

The trickier bit is adding the tag to the tag group. I don’t see a way to this this programmatically as of now…

---

<div class="post-metadata">

### Author: ![tknospdr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tknospdr/32/529762_2.png) [@tknospdr](https://meta.discourse.org/u/tknospdr)
#### Post date: [May 11, 2025, 1:54am UTC](https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584/3 "2025-05-11T01:54:21Z")

</div>

> [@NateDhaliwal](#):
>
> You could make an API call to grt the topic’s poster, which will be the company’s name.

Actually, I can’t because…

> [@tknospdr](#):
>
> I can’t do it via ‘email domain’ as a lot of our users don’t have company specific e-mail addresses.

We have users with e-mails like [businessname@gmail.com](mailto:businessname@gmail.com) & [first.last@icloud.com](mailto:first.last@icloud.com) that both belong to the same company.

I don’t need to programatically create the list. I’m happy to add the terms, I just want to be able to restrict them to only be available under a certain category.

Maybe the only way for this to work is to create an SOP to add the tag ahead of time as each company gets onboarded.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [May 11, 2025, 9:23am UTC](https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584/4 "2025-05-11T09:23:38Z")

</div>

sounds similar to this

> [@Autocompletion on creation Topic with the right tags](https://meta.discourse.org/t/autocompletion-on-creation-topic-with-the-right-tags/292520):
>
> I’m looking for a new plugin or a functionnality that could do that : When you create a new topic, it automatically propose existing tags or new tags according to the content of the topic. Ex : Is the usage of Flows on JetPackCompose recommended ? val numbersFlow: Flow = flow { repeat(60) { it → emit(it+1) //Emits the result of the request to the flow delay(1000) //Suspends the coroutine for some time } } Potential tags displayed : JetPackCompose, Kotlin, Flow

you may be able to do something with a combination of AI and automation plugins 🤔

---

<div class="post-metadata">

### Author: ![tknospdr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tknospdr/32/529762_2.png) [@tknospdr](https://meta.discourse.org/u/tknospdr)
#### Post date: [May 12, 2025, 11:28pm UTC](https://meta.discourse.org/t/create-dynamic-tag-group-at-topic-level/365584/5 "2025-05-12T23:28:27Z")

</div>

> [@Lilly](#):
>
> you may be able to do something with a combination of AI and automation plugins 🤔

Thanks, but I don’t really care about automation.  
I want to just create a new tag like you normally would, the only change is that I want to be able to set that tag as a member of a specific tag group at time of creation.
