# \[PAID GIG\] Requirements for Discourse Plugin for Topic View Serializer

**URL:** <https://meta.discourse.org/t/paid-gig-requirements-for-discourse-plugin-for-topic-view-serializer/151002>\
**Category:** Marketplace\
**Created:** [11 mei 2020 om 03:37 UTC](https://meta.discourse.org/t/paid-gig-requirements-for-discourse-plugin-for-topic-view-serializer/151002 "2020-05-11T03:37:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)\
**Post date:** [11 mei 2020 om 03:37 UTC](https://meta.discourse.org/t/paid-gig-requirements-for-discourse-plugin-for-topic-view-serializer/151002/1 "2020-05-11T03:37:24Z")

</div>

## What would you like done?

RE: [https://community.unix.com/](https://community.unix.com/)

We have just completed migration to Discourse but are leaving our old forums accessible until 2021 because we have two decades of legacy code, which each of our members are proud of (and put a lot of work into).

For our staff who would like to check the integrity of migrated code from time-to-time, we would like a small plugin to split the `value` from the `topic_custom_fields` and add only the integer (which is the legacy forum thread id) to the `TopicViewSerializer`, so the JSON serializer with have the additional key, value pair:

```plaintext
"import_id" : <thread_id_of_legacy_forum>

```

See query below as an example, so the value added to the `TopicViewSerializer` (for this Discourse topic\_id) will be:

```plaintext
"import_id": 284071

```

```plaintext
postgres=# \c discourse
You are now connected to database "discourse" as user "postgres".
discourse=# select * from topic_custom_fields where name like '%import_id%' and topic_id = 377947;
   id | topic_id | name | value | created_at | updated_at         
--------+----------+-----------+---------------+----------------------------+----------------------------
 239520 | 377947 | import_id | thread-284071 | 2020-04-22 03:20:03.968513 | 2020-04-22 03:20:03.968513
(1 row)

```

We want to use this property in a template component as follows:

```plaintext
{{import_id}}

```

Because we would like a small `<span>` template component for the `topic-category` `plugin-outlet` , which will look like this (and visible to only our specified trust level):

```plaintext
<span class='import-id'>Legacy Forum Thread <a class='import-id-link' href='https://www.unix.com/showthread.php?t={{import_id}}'>{{import_id}}</a></span>

```

## When do you need it done?

Anytime in the next few weeks is fine. No big rush.

## What is your budget, in $ USD that you can offer for this task?

All reasonable quotes for this small plugin are welcome.

## Additional Info

We plan to make this code freely available to all who have done a similar migration. However, it is very possible that other legacy forums many not have such a high `data integrity` concern for legacy code, and so it’s possible our forum will be the only forum who uses this plugin.

I did a “overly complex” and so maybe an “inaccurate” write up on this requirement yesterday; so I think the description above is simpler and easier to understand (hopefully):

> **[\[DONE\] Requirements for Discourse Plugin for Topic Serializer (API) v2](https://community.unix.com/t/done-requirements-for-discourse-plugin-for-topic-serializer-api-v2/378385)**
>
> Proposed Plugin Overview: Plugin Outlet: topic-category Discourse plugin to add a integer value from the topic\_custom\_fields postgres table and insert that value as follows into the appropriate topic JSON API serializer so it will be available...

## Footnote

Worked on this small plugin myself for a number of days, my first attempt at a Discourse plugin, and kept getting a `null` value for `import_id` in the `TopicViewSerializer`.

## Update

Thanks to a bit of kindness and tutoring, I have the serializer part of this task working now.

---

_[View the full topic](https://meta.discourse.org/t/paid-gig-requirements-for-discourse-plugin-for-topic-view-serializer/151002)._
