You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I'm at my wits end with this. Its not just Jira, but code snippets are generally terrible replacements in HTML based windows. I get how HTML playsd with whitespace, but I feel like this has all gone back to the dark ages as far as development goes.
I just want to paste code in to a ticket comments, whether it is with the code snippet short cut button "<>" and maintain a few tabbed indentations.
Other tools like MS Teams implement this, in equally bad ways where the code is unreadable.
I'm not expecting an IDE, but the atrocious manner for code in comment mark up is stunning.
I share OP's frustration. I'm trying to copy in a chunk (20 lines) of space-indented JSON into a Jira ticket comment. No matter how I paste it, not only are indenting spaces removed, line-ends are removed, wrapping all lines of the JSON into a single line.
I have tried:
All fail identically.
I'm using Chrome on a Mac.
I just tried pasting and re-copying to vi, and THIS WORKED! Formatting was preserved to the Jira comment.
I then went back to VSCode and changed the Language Mode from JSON to Plain Text, copied the text, and this also successfully pasted into the Jira comment, with indents.
So apparently VSCode is doing something "interesting" when copying code from a JSON-language editor. I repeated this experiment from Sublime editor in Plain Text and JSON language modes, and it always pasted correctly into Jira, preserving the indents and line feeds.
I suspect many of the threads complaining of this problem, that get "not reproducible" responses are reflections of the application copying the text in the first place, not how Jira pastes the text.
Hi @Stephen Wilson, welcome to the Atlassian Community.
I've been using the code snippet, and it works fine for me. It gets a bit messy if it's a large snippet, but I'd say it probably shouldn't be there if it's a large one.