Skip to content

Fix timer control missing from issue view on Jira DC/Server 10+#439

Open
reikjarloekl wants to merge 1 commit into
shridhar-tl:masterfrom
automaze-me:fix/dc10-timer-toolbar
Open

Fix timer control missing from issue view on Jira DC/Server 10+#439
reikjarloekl wants to merge 1 commit into
shridhar-tl:masterfrom
automaze-me:fix/dc10-timer-toolbar

Conversation

@reikjarloekl

Copy link
Copy Markdown

Problem

Fixes #425.

After upgrading a Jira Data Center/Server instance to Jira 10, the worklog timer control no longer appears in the issue-view command bar (it used to sit next to the Edit / Comment buttons).

Root cause

applyIssueLogic() locates the DC/Server toolbar with:

div.issue-header-content .command-bar .ops-menus > div:first-child > div:first-child

In Jira 10 the AUI toolbar structure is:

.ops-menus.aui-toolbar2
  └─ div.aui-toolbar2-inner        ← ".ops-menus > div:first-child"  ✓ (a <div>)
       ├─ ul.aui-toolbar2-primary  ← "> div:first-child"  ✗ it's a <ul>, not a <div>
       └─ div.aui-toolbar2-secondary

The final > div:first-child expects a <div>, but the first child of .aui-toolbar2-inner is now <ul class="aui-toolbar2-primary">. The selector matches nothing, so el.length === 0 and the function returns early — the timer control is never injected.

Fix

Keep the original selector as the primary lookup (unchanged behaviour on pre-10 Jira, so no regression there) and fall back to the stable .aui-toolbar2-inner container only when the original finds nothing (Jira 10+):

el = $('div.issue-header-content .command-bar .ops-menus > div:first-child > div:first-child');
if (!el.length) {
    el = $('div.issue-header-content .command-bar .ops-menus .aui-toolbar2-inner');
}

Verification

  • Reproduced against a real Jira DC 10.3.x issue page: the original selector returns 0 matches; the fallback returns 1, and the injected control lands in the same toolbar as the Edit button.
  • Built the extension and confirmed the fix in the bundled content script; timer control confirmed working in the issue view on Jira DC 10.
  • Backward compatible by construction: pre-10 Jira uses the untouched primary selector.

Since Jira Data Center/Server 10, the command-bar toolbar's inner
container (.aui-toolbar2-inner) has a <ul class="aui-toolbar2-primary">
as its first child instead of a nested <div>. The existing selector

    .ops-menus > div:first-child > div:first-child

therefore matched nothing, so applyIssueLogic() returned early and the
worklog timer control was never injected into the issue view toolbar.

Keep the original selector as the primary lookup (so behaviour on
pre-10 Jira is unchanged) and fall back to the stable
.aui-toolbar2-inner container when it finds nothing (Jira 10+).

Fixes shridhar-tl#425
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.

Jira DC 10: Timer not showing in issue view

1 participant