Auto-populate Description field for specific project in JIRA with a table

I've auto-populated description field with text before. I need help with auto-populating it with a table with columns. Can you give directions on how to achieve this? I tried some javascript code but it doesn't display anything on Create screen.

2 answers

0 votes
Ignacio Pulgar Community Champion Dec 02, 2017

If you have ScriptRunner, then have a look at how to achieve it through Behaviours:

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html#_setting_a_default_description

So I should be writing a Groovy script for creating table with columns right?

Ignacio Pulgar Community Champion Dec 06, 2017

You may create a table with wiki notation:

||column 1||column 2||column 3||

|cell value 1|cell value 2|cell value 3|

If you would like to get a more sophisticated table, you may want to have a look at the Table Grid Editor plugin, which lets you create a table as a custom field.

My reply didn't get posted when I tried to hit reply after typing the message here, so I replied under Suggest an Answer field

I've already tried this before I raised a question here. I've enabled wiki style renderer to the description field which shows a table when I put in the above wiki notation (it actually looks more like separated rows with columns rather a table). But what I need is to auto-populate a table with column headers in the description field on the create screen. Earlier, I've auto-populated text in description field by putting javascript under the below path.
JIRA administration --> Issues --> Fields --> Field Configurations --> Description [Wiki Style Renderer] --> Edit --> Edit Field Description: Description --> place the javascript under Description box here

In the same way, how do I modify this javascript to populate the description field with a table having column type headers such as: Column1 | Column2  | Column3 | Column4  | Column5 | Column6

I went through your first response and tried using a behaviour. I was successfully able to display text in Description field using a behaviour. But, I need to know the function to be used to populate a table in the description field. I have googled and all that I see is to how to CREATE TABLE in a database but I don't need that. All I need is to create a simple table with rows and columns having column headers so that users can input their details into the table.


I've also checked the Table Grid Editor plugin but I need this for the system field (Description) but not for custom fields in my case.

Ignacio Pulgar Community Champion Dec 06, 2017

Have you tried the wiki notation of a table in conjunction with a behaviour? That way you may define one or more tables with the appropriate column headers for any project & issue type combinations.

I tried that, pls see the results above

first is expected, second is actual

Ignacio Pulgar Community Champion Dec 06, 2017

May you click on the Text tab of the actual result to see its wiki notation?

Ignacio Pulgar Community Champion Dec 06, 2017

Try copying this in Text mode:

||column 1||column 2||column 3||
|cell value 1|cell value 2|cell value 3|
Ignacio Pulgar Community Champion Dec 06, 2017

I suspect you have one extra carriage return between both lines, which is causing the weird display of the table. Just remove the empty line between the column headers and the first row and the table will be displayed correctly.

Suggest an answer

Log in or Join to answer

Stay in touch

Be the first to know what's trending on Atlassian Community