Requirements:
Be able to assign an SQL DataSource Table as the primary source of truth (source of most up-to-date TGNG data)
Update the Jira CUSTOMFIELDTABLE DB value according to the DB Table value (On Issue load and API access event)
check if JQL search and Jira Issue Export trigger any of our methods (pull data periodically to keep the Jira version fresh?)
The feature should be an extension of the Data Mirror functionality
Add a button to allow users to pick whether they want the Data Mirror table to be the source of truth
Add a checkbox labelled “Treat DataSource value as primary during sync (overwrites Jira value)” (or other wording that would sound better)
Use Case (Data Flow):
The user defines an SQL data source
In the Grid config, the user sets up Data Mirror and checks the box to make it the primary storage
An info panel with table handling restrictions is displayed (Do not change the table schema or it will break)
A checkbox is presented labelled something like “Treat DataSource value as primary during sync (overwrites Jira value)”
Any pre-existing data is mirrored to the DB Table (as in Data Mirror)
Any changes in the DB Table after that are reflected on Issue View and when REST API is called
If an error occurs because of DB Table data type incompatibility (or any other SQL-related data), the error message should include that information
Any changes by the user (on issue or via REST/Java API) are first reflected in the table and then saved to the default Jira storage
If the save is not possible due to the change in the DB Table, an error should be displayed detailing the cause
The JQL search is using the most up-to-date values that are taken from the DB Table
Use-case clarification
Usecase | Description | Questions to Clarify | Answers | |
---|---|---|---|---|
1 | Connect to the datasource | Users configure the connection from the app to the external datasource. |
|
|
2 | Display data from the datasource | Data from the datasource is displayed in tables within the app. |
|
|
3 | Update data in the app | Users can update data in the app, and the changes are reflected in the external datasource. |
|
|
4 | Update data in the datasource | Updates made in the datasource are synchronized back to the app. |
|
|
5 | Synchronize datasource schema | Automatically detect and adapt to the structure (schema) of the datasource for compatibility. |
|
|
6 | Error handling and notifications | Users are informed of connection issues, synchronization errors, or invalid data. |
|
|
7 | Security and access control | Ensure that only authorized users can access and update data. |
|
|
8 | Logging and audit trail | Log all actions related to data synchronization for troubleshooting and auditing purposes. |
|
|
9 | Data transformation and mapping | Define how the datasource data is mapped to the app's data structure. |
|
|
Plan of action:
Check how TGE handles a similar functionality
Implement a naїve version of the functionality (always overwrites on sync, doesn’t handle getCustomfieldValue, etc.)
Validate whether all of the points in the Questions are relevant to the actual behaviour of the Grid in that basic implementation version.
Write potential answers/suggestions to the questions with some detail on the implementation.
Get approval on the clarifications from Questions
Agree and document the timescale of the full implementation, and add it to the overall roadmap.
Implement a more thorough version of the functionality
Questions:
Question | ||
---|---|---|
1 | If the connection to the DB is lost temporarily, do we lock the Grid from being edited? Do we block it from being viewed? | Hung: To simplify the process, we can display a warning to notify users when the data is not synchronized correctly. Additionally, we can provide a "Re-synchronize" button, which, when clicked, will fetch all the data from the database and replace the current data in the UI grid. This approach ensures that the database acts as the primary source for synchronization. |
2 | Does this functionality need to be present on Cloud as well as on Server | Hung: There is no restriction so I think we can do for both |
3 | How the TGE manages the getCustomfieldValue call from Jira’s own API? Do we provide the data pulled from the table on that call? Is it a Service that TGE exports? | |
4 | How will the Row ID be handled when new rows are added on the DB side and not through the regular means (manual, API)? Does the ID get generated when the data is loaded into the Jira Grid view? Does it get generated automatically? | Hung: We keep auto_increment ID on both side, and use another field “UUID” to manage the data to synchonize. With the data save from FE, we can use library like WIth the data save from database, we can use function CREATE TABLE MyTable ( id INT AUTO_INCREMENT PRIMARY KEY, uuid CHAR(36) NOT NULL DEFAULT (UUID()), name VARCHAR(255), age INT ); |
5 | If the DB Table sourced rows contain non-standard Row IDs, do they get transformed and re-inserted? Can we make the correct format of the Row ID be populated on the SQL side? | Hung: the same answer as above |
6 | Should we use a different format for Row IDs that are primarily stored in a remote DB? | Hung: UUID is an option that I suggest |
7 | Should the case of initialising TGNG from a pre-existing table be supported? | Hung: Yes, that is also a case that Francis suggest when we talk about bulk import |
8 | Do we handle Attachment columns by just storing the Attachment ID? | HUng: Tested on current Data Mirror function, it will save the Attachment ID with the |
9 | Do wrong/non-existing Attachment ID values get ignored or do we add a custom error? Does the same behaviour apply to wrong/non-existing values on User/Multi/Single-select? | Hung: With the current behaviour, it will ignore, so do User/Multi/Single-select. But to make it more effective, we can display a |