How to Format Code Blocks in Jira
Wrap the code in a {code} macro, or use the code block button in the new editor. Markdown fences do not work in Jira. Covers language hints, {noformat}, and inline code.
Direct answer
To format code in Jira, wrap it in the {code} macro: {code:java} on the first line, your code, then {code} on the last line. Markdown fences (```) do not render in Jira — they stay as literal backticks. In the new Jira Cloud editor you can also press the code block button in the toolbar, or type /code and pick Code snippet.
Open Markdown to Jira converterWhen to use this
- Code pasted into a Jira description lost its indentation and line breaks.
- A ticket needs a stack trace, log excerpt, or SQL query that stays readable.
- You draft tickets in Markdown and the fenced blocks arrive in Jira as backticks.
Steps
- Decide the block type: {code} for source code and commands, {noformat} for logs and stack traces.
- Add a language hint after the macro name, such as {code:java} or {code:python}, to get syntax highlighting.
- Put the opening macro and the closing macro on their own lines, with the code between them.
- In the new Jira Cloud editor, use the toolbar code block button or type /code instead of the macro text.
- For a word inside a sentence, wrap it in double braces: {{config.yaml}} renders as inline monospace.
- Paste the ticket, then preview it and confirm the block has a border and keeps its indentation.
Example conversion
The import job fails on the currency column.
```python
def load(row):
return row["currency"]
```
Log output:
```
KeyError: 'currency'
File "etl.py", line 88
```
Check the `currency` field in the source file.The import job fails on the currency column.
{code:python}
def load(row):
return row["currency"]
{code}
Log output:
{noformat}
KeyError: 'currency'
File "etl.py", line 88
{noformat}
Check the {{currency}} field in the source file.Common mistakes
- Do not paste Markdown fences into Jira. Jira has no fenced code block syntax, so the backticks stay visible.
- Do not leave a {code} macro unclosed. Jira treats the rest of the ticket as code until it finds the closing macro.
- Do not put a code block inside a table cell. Rendering is unreliable; attach the file or link to it instead.
- Do not add a language hint to a stack trace. The colors are wrong; use {noformat} instead.
FAQ
- Does Jira support Markdown code blocks?
- No. Jira description and comment fields do not render triple-backtick fences. Jira uses the {code} macro in wiki markup, or the code block element in the new Cloud editor. Convert the fences before you paste.
- How do I add a code block in the new Jira Cloud editor?
- Type /code and select Code snippet, or press the code block button in the toolbar. The old wiki markup text field is not shown by default in the new editor, so the macro text may render literally there.
- What is the difference between {code} and {noformat} in Jira?
- {code} adds a language and syntax highlighting, so it fits source code, SQL, and commands. {noformat} keeps the text exactly as written with no coloring, so it fits logs, stack traces, and diffs.
- Which languages does {code} accept in Jira?
- Common values are java, python, bash, sql, javascript, json, xml, and yaml, written as {code:java}. An unknown value still renders a plain monospaced block.
- How do I show a single word as code in Jira?
- Wrap it in double curly braces. {{api_key}} renders as inline monospace text inside the sentence. Markdown single backticks do not work.
Related Jira guides
Markdown Acceptance Criteria to Jira
Convert Markdown acceptance criteria into Jira wiki markup that stays readable in issue descriptions.
AI Coding Notes to Jira Ticket
Turn rough AI coding session notes into a Jira implementation ticket with scope, telemetry, and tests.
QA Repro Steps Jira Template
Format QA repro steps, environment details, evidence, and acceptance criteria as a Jira bug ticket.
Jira Markdown vs Wiki Markup
Why Markdown breaks in Jira description fields, how Jira's own wiki markup differs, and a side-by-side of the syntax that trips people up.
Jira Markdown Table: Convert a Markdown Table to Jira
A Jira markdown table uses ||double pipes|| for headers and no separator row. Convert Markdown pipe tables into Jira wiki markup tables that render in descriptions and comments.
Markdown Code Blocks to Jira
Turn Markdown fenced code blocks into Jira {code} macros with language highlighting, and use {noformat} for logs and stack traces.
Does Jira Support Markdown? What Works and What Does Not
Jira does not render pasted Markdown in description or comment fields. This guide shows which fields accept Markdown for Jira, which need wiki markup, and how to convert.
How to Paste Markdown Into Jira
Paste Markdown into Jira without broken formatting: convert to wiki markup first, then paste into the description or comment field. Covers tables, code blocks, and the API case.
Jira to Markdown: Convert Wiki Markup Back to Markdown
Convert Jira to Markdown: turn wiki markup from descriptions and comments — h2. headings, {code} blocks, ||header|| tables — into clean Markdown for docs, README files, and AI tools.
Gear and reading for ticket work
One book on writing epics and stories that survive a sprint, plus the hardware for a day of it.
The Epic Guide to Agile
Covers the part most Scrum books skip: shipping on a schedule you can actually predict, and writing epics and stories that survive contact with a sprint.
- Epics, stories, and estimation
- Predictable release planning
- Practical Scrum, not certification prep
- Pairs with the Jira and epic tools
Dell 27" S2725QC 4K
The monitor I write and review documents on. 163 PPI keeps small text sharp, and USB-C carries video and power on one cable.
- 3840x2160 IPS, 163 PPI
- 120Hz, 4ms, FreeSync Premium
- 99% sRGB
- USB-C, HDMI, DisplayPort
Apple MacBook Neo 13" (A18 Pro)
The cheapest way into an Apple-silicon machine that runs local models. Fanless, and the Liquid Retina panel holds small text at a full day of reading.
- A18 Pro chip, built for Apple Intelligence
- 8GB unified memory, 256GB SSD
- 13-inch Liquid Retina display
- 1080p FaceTime HD camera
Amazon affiliate links. We earn a commission on qualifying purchases at no extra cost to you.