Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to insert Wiki markup {noformat} into description field

We have a process which creates issues in Jira via Rest API. The description field may contain Wiki markup strings, for example '-- which leads to a strike through. I therefore wrote a listener (create, update) which reads and updates the description field with a {noformat} string at the beginning and the end of the original description text.

The code is like this:

String newDescValue = "{noformat}" + System.getProperty("line.separator") + descValue + System.getProperty("line.separator") + "{noformat}"

The result extremly strange. 

Any idea what groovy, scriptrunner or Jira are doing? Adding the text directly into the UI works fine.


1 answer

1 accepted

0 votes
Answer accepted

You are likely creating a loop.

When you update the description, you trigger the listener again and it triggers another update.

You are lucky it only did it 8 times.

You should first check if the description already contains {noformat} and only update it if it doesn't.

def sep = System.getProperty("line.separator")
def tag = '{noformat}'
  descValue = "$tag$sep$descValue$sep$tag"

Thanks for your answer. I will have a look next week. Can't really believe this to be true, because I print the variable descValue to the log before actually updating the field and it already looks as described. But we will see.

Hi Peter-Dave again,

we never got it working this way. We got around it by adding the {nofomat} directly into the rest api call.


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events