rubyforgood / discourse-ticketing

Ticketing system for Discourse
GNU General Public License v2.0
0 stars 0 forks source link

How does discourse represent the relationship between tags, topics, and sub-tags? #26

Closed willmurphyscode closed 6 years ago

willmurphyscode commented 6 years ago

Here's what we've learned:

  1. A lot of the code that makes actual API calls is in ember model files, which ember routes files use set model on the ember controller.
  2. The doesn't appear to be an API call that gets all of what we want easily, so we will need to add an API route in our plugin.
  3. Since we're writing new controller actions anyway, we can make them return what we need.
  4. We're probably going to find tags and tag groups by hard-coded names. We can fix this to be configurable later, but we're not going to right now.
bhaibel commented 6 years ago

Tentative API:

GET /ticketing/tickets/

returns a bag of ticket-related information as a giant array

[
  {
    "id": 432,
    "topicOrMessage": "topic"
  }
]

(for additional fields, see the individual routes so that we don't duplicate this all over the place)

GET /ticketing/tickets/:topicOrMessage/:id

returns a bag of ticket-related information derived from ticket tags:

{
  "id": 432,
  "topicOrMessage": "topic",
  "priority": "immediate",
  "status": "waiting",
  "reasons": ["onboarding", "helpdesk"],
  "otherTags": ["location-america", "language-english"],
}