Skip to content

jira integration part 3 - show diff between tmetric and jira - #33

Merged
individual-it merged 3 commits into
mainfrom
jiraintegration-2
Nov 16, 2026
Merged

individual-it merged 3 commits into
mainfrom
jiraintegration-2

Conversation

@individual-it

@individual-it individual-it commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

With this change the diff command will also include:

  1. tmetric projects that are configured for jira
  2. data from jira

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Jira integration breaks OpenProject-only configurations and can fail or produce incorrect totals due to timezone boundaries, oversized worklog requests, and missing author filtering.

4 open issues
What changed in this PR

Builds on the Jira copy integration by extending diff to compare Tmetric entries with Jira worklogs alongside OpenProject time entries.

Changes:

  • Fetches Jira worklogs and displays issue details, durations, and combined time differences.
  • Adds user timezone metadata and timezone-aware Jira worklog conversion.
  • Updates client-scoped validation, copy commands, setup documentation, and the HTTP dependency.
File Description
tmetric/​user.go Captures timezone metadata from both user API formats.
tmetric/​tmetric.go Adds client filters to entry validation and transfer selection.
tmetric/​tmetric_test.go Updates validation tests and adds client-filter cases.
tmetric/​timeentry.go Converts entries to Jira worklogs using user timezones.
README.md Documents timezone setup and destination-specific copy commands.
jira/​worklog.go Adds worklog models, metadata handling, comment extraction, and saving.
jira/​jira.go Retrieves worklogs and filters them for comparison.
jira/​issue.go Adds project details to Jira issue data.
go.sum Adds checksums for the updated Resty dependency.
go.mod Updates Resty to version 2.17.2.
config/​config.go Removes the obsolete client field while retaining configuration validation.
cmd/​tmetric.go Adapts checks to the client-filter parameters.
cmd/​diff.go Includes Jira entries in the comparison table and totals.
cmd/​copy.go Shares validation and selection between destination subcommands.
cmd/​copy-openproject.go Separates OpenProject copying into its own subcommand.
cmd/​copy-jira.go Adds the Jira copy subcommand and transfer flow.

Review effort: Balanced

Comment thread cmd/diff.go Resolved
Comment thread jira/jira.go Resolved
Comment thread jira/jira.go Resolved
Comment thread jira/jira.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved Jira retrieval and date-boundary bugs can omit valid worklogs, while an unguarded OpenProject user lookup blocks diff --user in Jira-only setups.

3 open issues
4 resolved since last review

Review effort: Balanced

Comment thread cmd/diff.go Resolved
Comment thread jira/jira.go Resolved
Comment thread jira/jira.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Jira worklogs lack warning padding, misaligning diagnostics, and failed issue lookups are cached, suppressing details and warnings for later entries.

2 open issues
3 resolved since last review

Review effort: Balanced

Comment thread cmd/diff.go Resolved
Comment thread cmd/diff.go Resolved
individual-it and others added 2 commits November 13, 2026 16:38
…successful lookups'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ep warnings aligned'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because unrelated string- or array-valued worklog properties can trigger decoding errors and abort the entire diff.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@PrajwolAmatya

PrajwolAmatya commented Nov 16, 2026 •

Copy link
Copy Markdown

The diff for jira didn't show up for few seconds.

This is what I did.

  1. In Tmetric had time log for jira and openproject
  2. checked and copied the respective time
go run main.go copy -s 2026-11-16 jira
go run main.go copy -s 2026-11-16 openproject
  1. check the diff
go run main.go diff -s 2026-11-16

Result:

+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+
| DATE       | TMETRIC ENTRY                            | TM    | PROJECT MANAGEMENT ENTRY                 | PM    | TIME | WARNINGS     |
|            |                                          | DUR   |                                          | DUR   | DIFF |              |
+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+
| 2026-11-16 | Description: test for jira               | 00:40 | Comment: test for op                     | 00:36 | 40   | - not my     |
|            | - Project: ocis-tests                    |       | - Project: JankariTech (EXT)             |       |      |   assignment |
|            | - Issue Key: OCISDEV-1371                |       | - WP ID: #58761                          |       |      |              |
|            | - Summary: [QA] JankariTech              |       | - WP: JankariTech - Reveal JS - meetings |       |      |              |
|            | - tmetric User: Prajwol Amatya           |       | - Activity: Coordination                 |       |      |              |
|            |                                          |       |                                          |       |      |              |
|            | Description: test for op                 | 00:36 |                                          |       |      |              |
|            | - Project: reveal.js integration         |       |                                          |       |      |              |
|            | - WP ID: #58761                          |       |                                          |       |      |              |
|            | - WP: JankariTech - Reveal JS - meetings |       |                                          |       |      |              |
|            | - Work Type: Coordination                |       |                                          |       |      |              |
+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+
|            |                                          |       | Total Diff                               |       | 40   |              |
+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+

On running the diff command for first time the time log of jira was not listed under PROJECT MANAGEMENT ENTRY and 40 min diff time was shown. I had to run the diff command 2-3 times and finally the diff was shown correctly.

+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+
| DATE       | TMETRIC ENTRY                            | TM    | PROJECT MANAGEMENT ENTRY                 | PM    | TIME | WARNINGS     |
|            |                                          | DUR   |                                          | DUR   | DIFF |              |
+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+
| 2026-11-16 | Description: test for jira               | 00:40 | Comment: test for jira                   | 00:40 | 0    |              |
|            | - Project: ocis-tests                    |       | - Project: ownCloud Infinite Scale       |       |      |              |
|            | - Issue Key: OCISDEV-1371                |       | - Issue Key: OCISDEV-1371                |       |      |              |
|            | - Summary: [QA] JankariTech              |       | - Summary: [QA] JankariTech              |       |      |              |
|            | - tmetric User: Prajwol Amatya           |       | - tmetric User: Prajwol Amatya           |       |      |              |
|            |                                          |       |                                          |       |      |              |
|            | Description: test for op                 | 00:36 | Comment: test for op                     | 00:36 |      | - not my     |
|            | - Project: reveal.js integration         |       | - Project: JankariTech (EXT)             |       |      |   assignment |
|            | - WP ID: #58761                          |       | - WP ID: #58761                          |       |      |              |
|            | - WP: JankariTech - Reveal JS - meetings |       | - WP: JankariTech - Reveal JS - meetings |       |      |              |
|            | - Work Type: Coordination                |       | - Activity: Coordination                 |       |      |              |
|            |                                          |       |                                          |       |      |              |
|            |                                          |       |                                          |       |      |              |
+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+
|            |                                          |       | Total Diff                               |       | 0    |              |
+------------+------------------------------------------+-------+------------------------------------------+-------+------+--------------+

I followed these step 2-3 times and 2 out of 3 times I saw this behavior. If we wait for few seconds before running the diff command then we get the correct diff.

@individual-it

Copy link
Copy Markdown
Member Author

I saw that behavior also in other places, e.g. when changing values in the UI it takes awhile till they are available through the API. I guess that is the nature of the DB / backend Jira is using.
I cannot think of anything we can do about that.

@individual-it
individual-it merged commit 167163a into main Nov 16, 2026
3 checks passed
@individual-it
individual-it deleted the jiraintegration-2 branch November 16, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants