How to use monospaced/code formatting in comment created by automation action?

Brat
Contributor
August 23, 2021

Hello

According to linked markup help in Jira automation it's possible to use {{some text}} syntax to display text monospaced ("more formatting" --> "Code" resp. CTRL+SHIFT+M in new rich text editor).

However the double curly brackets are reserved for smart values in automation already.

How to use monospaced formatting within comments generated by automation?

Many thanks

2 answers

1 accepted

6 votes
Answer accepted
Zacaries Benamiar
Contributor
December 22, 2021

Hey Brat,

I came up with a workaound.

Create two variables:

  • openingCurlyBrackets with value \{\{
  • closingCurlyBrackets with value \}\}

Then you can set monospace text this way:


 {{openingCurlyBrackets.remove("\\")}}my text in monospace format{{closingCurlyBrackets.remove("\\")}} 

Brat
Contributor
December 23, 2021

Cool, this really works! Many thanks Zakaria!

Like # people like this
Adam July 28, 2022

thank you, this is so lame...

I went for this variation, create four variables:

  • codeOpenRaw with value \{\{
  • codeCloseRaw with value \}\}
  • codeOpen with value {{codeOpenRaw.remove("\\")}}
  • codeClose with value {{codeCloseRaw.remove("\\")}}

Then use it as {{codeOpen}}my text in monospace format{{codeClose}} 

this is so lame (it really is)

Like # people like this
Hcohen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 4, 2023

If you need to use this in multiple words it's a little lengthier but this is what I did:

Set project-level entity properties for the four variables above in a one-time rule (pick a random issue and run a manual or scheduled trigger).

Use it as {{project.properties.codeOpen}}my text in monospace format{{project.properties.codeClose}} in any rule you want!

Like Zacaries Benamiar likes this
Moritz Reiter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 17, 2024

Oh my god, Atlassian, what the heck are you doing???

In Markdown, you can just do: `this-is-formatted-in-monospace`.

Why does Atlassian hate developers so much?

Adam January 16, 2025

Anyone finding this isn't working now? My text is appearing as normal text without any code formatting.

Anyone know the latest fix?

0 votes
Ignacio
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2021

Hi Brat!
You should open the smart value with a backslash
For example:

\{\{monospace\}\}

Brat
Contributor
August 26, 2021

Hey Ignacio

Many thanks for your response. Unfortunately it didn't work in my rule:

This...
jira1.png
...becomes...
jira2.png

Do you see what I'm doing wrong?

Like Brad likes this
Zacaries Benamiar
Contributor
December 22, 2021

I'm experiencing the same issue..

Like # people like this

Suggest an answer

Log in or Sign up to answer