Jira Cloud <> Jira on-prem: How to make all embedded images clickable (thumbnails)

Originally asked by Serhiy Onyshchenko on 16 March 2022 (original question)


As the title suggests, I’d like all the images synchronized from Jira Cloud to Jira on-premise to be clickable.


Answer by Serhiy Onyshchenko on 23 March 2022

Hello, Marcus Nygren ,
Thanks for the tip.
Here’s my script that is converting all the images into thumbnail-able images (replaces the given line in the incoming sync script on Jira on-prem):

//replace
//issue.comments     = commentHelper.mergeComments(issue, replica)
// withreplica.addedComments = replica.addedComments.collect { c ->
  def matcher = c.body =~ /!([^\|]+)\|([^t][^!]+)!/
  if (matcher.hasGroup()) {
    def m = matcher as List
    c.body = m.inject(c.body) { b, subMatch ->
      b = b.replace(subMatch[0], "!${subMatch[1]}|thumbnail!".toString()) 
      b
    }
  }
  c
}
issue.comments = commentHelper.mergeComments(issue, replica)

Here’s how it works:

CC: Vinay

Happy Exalating


Answer by Marcus Nygren on 18 March 2022

Hello Serhiy,

The syntax for making an attachment clickable in Jira Server or Data Center is

!imageName.png|thumbnail!

If you alter the content of the field from cloud with a similar value, you should get a clickable image.

The syntax for the same image uploaded to a comment in cloud looks like this

!imagename (69707e93-425b-44d4-98de-950016f67c08).png|width=44,height=35!

The part between the pipe character and last exclamation mark on cloud can be appended with “,thumbnail” to achieve this effect. Turning it into

!imagename (69707e93-425b-44d4-98de-950016f67c08).png|width=44,height=35,thumbnail!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.