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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.