An anchor set in a JIRA comment doesn't work

Ed January 30, 2020

I used the online Text Formatting help in JIRA to set an anchor in my text, using the format {anchor:MyAnchor}, but using that anchor doesn't work. I use the anchor address http://my-jira-host/browse/issue-number#MyAnchor (both through a link and a manually-entered address) and it will go to the top of the correct issue page, but the browser will not go to my anchor.

Apparently, anchors will not work if placed in a comment, because JIRA doesn't render all comments until they are expanded. If I navigate to the collapsed comments, expand them, then re-enter the anchor address in the address bar, the browser navigates to it successfully.

A link to that text won't work from another issue or even from the same issue page without manually expanding comments. The problem is that JIRA starts with the comments collapsed and is constantly collapsing the comments section, obviously making the anchor inaccessible for the browser to find.

How can I set an anchor in a JIRA comment that will actually go to the anchored text I link to?

1 answer

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2020

JIRA stores the comment in plain text so any formatting is discarded

Ed February 3, 2020

Sorry but no, formatting is not discarded from the regular comments; only the Root Cause and Resolution Notes comments ignore formatting. Regardless of how it's _stored_, it still is _rendered_ as HTML for the browser to display. But JIRA hides comments when you first go to a page, so the anchor that is eventually rendered when the comment is expanded isn't on the page yet.

I did find out that using a "permalink" has some extra data stuffed into the URL to force a comment open. As a workaround, I had to use permalinks instead of anchors and simple links.

Suggest an answer

Log in or Sign up to answer