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
Next: Root
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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
.
.
.
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
'--RGO/////XBR23/ZR00553/------'
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
{noformat}
.
.
.
Any idea what groovy, scriptrunner or Jira are doing? Adding the text directly into the UI works fine.
{noformat}
'--RGO/////XBR23/ZR00553/------'
{noformat}
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}'
if(!descValue.contains(tag){
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.