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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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
4,556,728
Community Members
 
Community Events
184
Community Groups

Insert table in Description (system field) using JIRA ScriptRunner Behaviour

Edited

Good day everyone, hope this post finds you safe and sound.

As per subject, the objective is to pre-load the table inside the Description (JIRA System Field)

Not sure if this is achievable using GUI (if yes, great), hence the question on ScriptRunner Behaviour.

We followed this, but could not make it work. We also saw, the table var is defined two times, we followed it blindly, but the Script Editor is showing error.

When we defined it once, no error is showing, but the table is not loading on the Visual tab as desired, but when we switched it to Text tab, the text for the table is the same as when we insert the tab manually.

Here is the desired table that we want to pre-load when a user is creating an issue

Screenshot 2021-09-24 at 10.47.01 AM.png

Here is the Text tab.Screenshot 2021-09-24 at 10.47.18 AM.png

We got confused when this post stated need to use Markdown, we tried that as well, but did not achieve it either.

This is the code in our behaviour.

import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours

@BaseScript FieldBehaviours fieldBehaviours

def desc = getFieldById("description")

def table = """Please enter your details in the below table -
||Heading 1|||Heading 2|||Heading 3|||Heading 4|||Heading 5|||Heading 6||
| | | | | | |
"""

desc.setFormValue(table)

Any pointers will be helpful!

Version for JIRA Project Management Software: 8.13.8

2 answers

1 accepted

1 vote
Answer accepted

By using HTML, we got what we need.

Hopefully this helps others who faced similar issue!

@Kamal Iqlaas Ismail can you share what your HTML looked like?

Hey @Caroline Hall , appreciate your response. Actually, we use MD again, as when we were developing, it was in staging environment, But when we deployed to production, everything work wonders!

 

Here is our code (screenshot)

Screenshot 2023-05-09 at 10.05.31 AM.png

Do note that there indentation for row is not needed.

0 votes
Suvarna Gaikwad
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Sep 23, 2021 • edited

@Kamal Iqlaas Ismail script looks fine except for table variable definition where there are additional | characters in between header.

Please try below.

def table = " " " Please enter your details in the below table - 

|| Heading 1|| Heading 2 || Heading 3 || Heading 4 || Heading 5 || Heading 6 ||

| | | | | | |

" " "

Apparently, we need to use HTML.

Appreciate your response though!

Could you please help with that code snippet?

Hi @Anjana Krishnan , please refer my answer to Caroline above. Thanks!

Suggest an answer

Log in or Sign up to answer