Skip to content

Support Portal

Arnab Dutta edited this page Apr 10, 2023 · 1 revision

Important Points

  1. Support Portal will be part of ADS.
  2. The discussion of opened tickets will take place on Rocket Chat.
  3. The user with the following roles can see the Support menu on ADS. We can assign the roles to the user using the Admin UI application (The role-permission assignment feature is already present).
Role Permission Scope
gluu-client - Create a new ticket.
- View/Edit/Delete/Close the tickets created by him.
- https://jans.io/oauth/scopes/support-portal/tickets.self.readonly
- https://jans.io/oauth/scopes/support-portal/tickets.self.write
- https://jans.io/oauth/scopes/support-portal/tickets.self.delete
support-team - Create/Edit/Delete/Close/Search all the tickets.
- View all Support team members.
- View all gluu-client.
- https://jans.io/oauth/scopes/support-portal/tickets.all.readonly
- https://jans.io/oauth/scopes/support-portal/tickets.all.write
- https://jans.io/oauth/scopes/support-portal/tickets.all.delete
- https://jans.io/oauth/scopes/support-portal/user.all.readonly
support-admin - Create/Edit/Delete/Close/View all the tickets.
- View/Add/Edit/Delete all Support team members.
- View/Add/Edit/Delete all gluu-client.
- https://jans.io/oauth/scopes/support-portal/tickets.all.readonly
- https://jans.io/oauth/scopes/support-portal/tickets.all.write
- https://jans.io/oauth/scopes/support-portal/tickets.all.delete
- https://jans.io/oauth/scopes/support-portal/user.all.readonly
- https://jans.io/oauth/scopes/support-portal/user.all.write
- https://jans.io/oauth/scopes/support-portal/user.all.delete
  1. We will have the following Support Portal menus on ADS.
.
└── Support/
    ├── Dashboard (not mandatory)
    ├── Register (Visible only if user has not registered in SP)
    ├── Tickets
    ├── Customers
    └── SupportTeam

Dashboard

image

Tickets

image

Dropdown fields options

Categories
Outages
Identity Management
Single Sign-On
Authentication
Access Management
Customization
Feature Request
Installation
Upgrade
Maintenance
Other
Log Out
Cache Refresh
Status
Open
Close
Priority
High
Low
Medium

New Ticket

Note:

  • Assigned To and Category field is enabled for only the following roles: support-team, support-admin. image

Open/Edit Existing Ticket

Note:

  • Assigned To and Category field is enabled for only the following roles: support-team, support-admin.
  • The newly opened ticket will have Open status by default(until it is changed). image

Search Clients

image

Add/Edit New Client

image

Search Support Team Member

image

Add/Edit Support Team Member

image

Steps to register new Support Portal user

  1. To add a new Customer or a support team member, the user first needs to log in to ADS. If the user is login for the first time then will be registered to the Jans persistence.
  2. The Gluu associate will assign the role (jansAdminUIRole) to the user from Admin UI. In this way, users will be able to access the Support Portal menus (based on role-scope mapping).
  3. When logging in for the first time after the role assignment, the user will see the Registration page. This Registration page will enter user details in the SP database.
  4. Basically, SP will check if there is an entry of the user in the user table (will query the table by username). If an entry is not present then it will show only Registration page else it will show all the menus permitted by his role (like Search/add/edit tickets etc).
  5. The support team member will see the Add/Edit Support Team Member screen and the Customer will see Add/Edit New Client screen to register.
  6. On screens mentioned on point# 5 username, email, first name and role fields will be populated with jans /user-info response data (call after authentication).
  7. To delete the registered user, the support admin needs to delete the user from both Jans (using user-management config-api) and the support portal (using the delete feature).

Support Portal features Authorization

image

  1. The logged-in user access to the Support Portal features is based on the role (jansAdminUIRole) assigned.
  2. The authentication script will pull the permissions based on the role assigned and add those to the session.
  3. The Update-Token script will add the permissions to id_token from the session.
  4. After login the permissions retrieved from id_token are used to provide access to the Support Portal features.

Support Portal - Rocket Chat communication (using rest endpoints)

Steps:

  1. Clicks on 'Open Rocket Chat discussion' of ticket image
  2. If not already logged in Support Portal will show a login page to enter the Rocket Chat username/password. image
  3. User will submit the username/password. The support portal will call rocket Chat's /api/v1/login endpoint and will save the response (user_id, token) in the cache.
  4. Support Portal call /api/v1/channels.create will create a channel with the ticket number on Rocket chat (if not present). image
  5. Support Portal will join the user to the channel using /api/v1/channels.join endpoint.
  6. Support Portal will open the Rocket Chat channel window (http://localhost:3000/channel/<channel_name>?resumeToken=<auth_token>) on another tab. User can discuss on the created channel.

Ticket close

  1. Pull all channel discussions to the SP database (/api/v1/channels.messages).
  2. The Support Portal will delete the ticket channel using /api/v1/channels.delete.
  3. Change the status of the ticket to Close on Support Portal.

Ticket Re-Open

  1. The closed tickets will show the Re-open Ticket button.
  2. On clicking on the Re-open Ticket button Support Portal will log in to Rocket Chat (if not already logged in).
  3. Create a Channel with ticket# as the name again on RC (as the previous channel was deleted).
  4. Add the user (re-opened the ticket) to that channel.
  5. Change the status of the ticket on SP to Open.
sequenceDiagram

title Support Portal Rocket Chat communication

autonumber
User->>Support Portal: Raises ticket
User->>Support Portal: Clicks on 'Open Rocket Chat discussion' of ticket
opt if the user is not already logged in to Rocket Chat
   Support Portal->>User: Show login page to submit username and password
   User->>Support Portal: Submits username/password
   Support Portal->>Rocket Chat: /api/v1/login
   Rocket Chat->>Support Portal: user_id, token etc
   Support Portal->>Support Portal: Save user_id, token in browser cache
end

opt if no ticket channel present
   Support Portal->>Rocket Chat: /api/v1/channels.create
   Rocket Chat->>Support Portal: create a channel and send the response
   Support Portal->>Rocket Chat:/api/v1/channels.join
   Rocket Chat->>Support Portal: joins the user to the channel
end
Support Portal->>User: open the Rocket Chat channel window (`http://localhost:3000/channel/<channel_name>?resumeToken=<auth_token>`) on another tab. User can discuss on the created channel.

Loading

DB schema (MySql)


// table to store support team members and customer details
CREATE TABLE user (
    id int NOT NULL,
    user_inum VARCHAR (50) NOT NULL,     //from gluu's persistence
    company_name VARCHAR (200), //field only for customer 
    Domain VARCHAR(50),        //field only for customer 
    username VARCHAR(100) NOT NULL,
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    email VARCHAR(200) NOT NULL,
    description TEXT,
    roles json NOT NULL,    //array of roles
    user_type VARCHAR(100)  NOT NULL, // either `customer` or `support_team`
    PRIMARY KEY (id)
);

// table to store tickets details
CREATE TABLE ticket (
    id int NOT NULL,
    subject TEXT NOT NULL,
    description TEXT NOT NULL,
    assigned_to_id INTEGER, // table: support_team (id) 
    customer_id INTEGER, // table: customer (id) 
    category VARCHAR(50) NOT NULL,
    status VARCHAR(10) NOT NULL,
    priority VARCHAR(10) NOT NULL,
    created_on DATE,
    rc_discussions json,
    PRIMARY KEY (id)
);

// table to store categories (e.g. Outages, Identity Management, Single Sign-On etc )
CREATE TABLE category (
    id int NOT NULL,
    name VARCHAR(50) NOT NULL,
    PRIMARY KEY (id)
);


// table to store the status of tickets (e.g. Open, Close )
CREATE TABLE status (
    id int NOT NULL,
    name VARCHAR (10) NOT NULL,
    PRIMARY KEY (id)
);

// table to store priorities of tickets (e.g. Open, Close )
CREATE TABLE priority (
    id int NOT NULL,
    name VARCHAR (10) NOT NULL,
    PRIMARY KEY (id)
);

APIs

API Method Comments
/v1/sp/status GET To create an application will minimal features a new status cannot be added to the application. Hence, POST, PUT and DELETE methods are not required.
/v1/sp/category GET To create an application will minimal features a new category cannot be added to the application. Hence, POST, PUT and DELETE methods are not required.
/v1/sp/priority GET To create an application will minimal features a new priority cannot be added to the application. Hence, POST, PUT and DELETE methods are not required.
/v1/sp/ticket GET, POST, PUT, DELETE
/v1/sp/user GET, POST, PUT, DELETE

GET /v1/sp/status

Description: Get all statuses.

Response

200

[{"id":1,"name": "Open"}, {"id":2,"name": "Close"}]

GET /v1/sp/category

Description: Get all categories.

Response

200

[{"id":1,"name": "Outages"}, ...]

GET /v1/sp/priority

Description: Get all priorities.

Response

200

[{"id":1,"name": "High"}, ...]

POST /v1/sp/ticket

Description: Create a support ticket.

Request-body:

{
"subject ":"---ticket subject string---",
"description":"---ticket description string---",
"assigned_to_id ":"----support team member id----",
"customer_id ":"----customer id----",
"category":"-- string --",
"status":"-- string --",
"priority":"-- string --",
"rc_discussions": [{"seq": 1, "user":"Fred","message":"working on this issue" },{"seq": 2, "user":"Sam","message":"Ok!" }]
}

Response

200

{
"id": 24354365656,
"subject ":"---ticket subject string---",
"description":"---ticket description string---",
"assigned_to_id":"----support team member inum value----",
"customer_id":"----customer inum value----",
"category":"-- string --",
"status":"-- string --",
"priority":"-- string --",
"created_on": 2022-03-08 00:00:00 ,
"rc_discussions": [{"user":"Fred","message":"working on this issue" },{"user":"Sam","message":"Ok!" }]
}

PUT /v1/sp/ticket/{id}

Description: Edit a support ticket.

Request-body:

{
"subject ":"---ticket subject string---",
"description":"---ticket description string---",
"assigned_to_id":"----support team member id----",
"customer_id":"----customer id----",
"category":"-- string --",
"status":"-- string --",
"priority":"-- string --",
"rc_discussions": [{"seq": 1, "user": "Fred", "message": "working on this issue" },{"seq": 2, "user": "Sam", "message": "Ok!" }]
}

Response

200

{
"id": 24354365656,
"subject ":"---ticket subject string---",
"description":"---ticket description string---",
"assigned_to_id":"----support team member inum value----",
"customer_id":"----customer inum value----",
"category":"-- string --",
"status":"-- string --",
"priority":"-- string --",
"created_on": 2022-03-08 00:00:00 ,
"rc_discussions": [{"user":"Fred","message":"working on this issue" },{"user":"Sam","message":"Ok!" }]
}

GET /v1/sp/ticket

Query-parama: id, assigned_to_id, customer_id, category, status, priority, created_on.

Description: Get all tickets

Response-body:

200

[{
"id": 24354365656,
"subject ":"---ticket subject string---",
"description":"---ticket description string---",
"assigned_to_inum":"----support team member inum value----",
"customer_inum":"----customer inum value----",
"category":"-- string --",
"status":"-- string --",
"priority":"-- string --",
"created_on": 2022-03-08 00:00:00 ,
"rc_discussions": [{"user":"Fred","message":"working on this issue" },{"user":"Sam","message":"Ok!" }]
}, ... ]

DELETE /v1/sp/ticket/{id}

Description: Delete a support ticket

Response-body:

200

{"response_code": 200, "message": "Record deleted successfully"}

GET /v1/sp/user

Query-parama: id, first_name, last_name, username, email, role, user_type.

Description: Get all users

Response-body: 200

[{
"id": 9,
"user_inum":"3fdf-34fd-5254",
"company_name":"--- name of the company for user_type customer----",
"domain":"--- domain of the company for user_type customer----",
"username":"--- username string ---",
"first_name":"---- first_name string ----",
"last_name":"---- last_name string ----",
"email":"--- email string ----",
"description":" --- user description ----",
"roles": [],
"user_type":" customer or support_team"
}, ...]

POST /v1/sp/user

Description: Create a new user.

Request-body:

{
"user_inum":"3fdf-34fd-5254",
"company_name":"--- name of the company for user_type customer----",
"domain":"--- domain of the company for user_type customer----",
"username":"--- username string ---",
"first_name":"---- first_name string ----",
"last_name":"---- last_name string ----",
"email":"--- email string ----",
"description":" --- user description ----",
"roles": [],
"user_type":" customer or support_team"
}

Response

200

{
"id": 9,
"user_inum":"3fdf-34fd-5254",
"company_name":"--- name of the company for user_type customer----",
"domain":"--- domain of the company for user_type customer----",
"username":"--- username string ---",
"first_name":"---- first_name string ----",
"last_name":"---- last_name string ----",
"email":"--- email string ----",
"description":" --- user description ----",
"roles": [],
"user_type":" customer or support_team"
}

PUT /v1/sp/user/{id}

Description: Edit a new user.

Request-body:

{
"user_inum":"3fdf-34fd-5254",
"company_name":"--- name of the company for user_type customer----",
"domain":"--- domain of the company for user_type customer----",
"username":"--- username string ---",
"first_name":"---- first_name string ----",
"last_name":"---- last_name string ----",
"email":"--- email string ----",
"description":" --- user description ----",
"roles": [],
"user_type":" customer or support_team"
}

Response

200

{
"id": 9,
"user_inum":"3fdf-34fd-5254",
"company_name":"--- name of the company for user_type customer----",
"domain":"--- domain of the company for user_type customer----",
"username":"--- username string ---",
"first_name":"---- first_name string ----",
"last_name":"---- last_name string ----",
"email":"--- email string ----",
"description":" --- user description ----",
"roles": [],
"user_type":" customer or support_team"
}

DELETE /v1/sp/user/{id}

Description: Delete a user

Response-body:

200

{"response_code": 200, "message": "Record deleted successfully"}

Clone this wiki locally