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.
If you have ScriptRunner, then have a look at how to achieve it through Behaviours:
So I should be writing a Groovy script for creating table with columns right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Divya
You told that you have already worked on auto-populated description field with text. Can I know the script once and how and where to run that script.
Could you please mention it ASAP.
Thank you
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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.
May you click on the Text tab of the actual result to see its wiki notation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try copying this in Text mode:
||column 1||column 2||column 3||
|cell value 1|cell value 2|cell value 3|
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
Now, I use similar script for a custom field but the text doesn't appear in the field on the create screen. Can you please help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would need some info to help you further:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I did follow the steps in the link and it worked for description
Below is my script for a new custom field called ServiceRequestDetails
def srd = getFieldById("ServiceRequestDetails")
def defaultValue = """Please enter the values for""".replaceAll(/ /, '')
I mapped the behavior to the correct project and issue type. The ServiceRequestDetails field is seen on the screen but it is empty. This is a multi-line text field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May you try this alternative line?
def srd = getFieldByName("ServiceRequestDetails")
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Reviewing the docs for Description:
There's no need to select the fields, as they are implicit in the code.
Perform the following actions, and try again after each of them:
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.
Yes, I have tried this earlier but with getFieldById instead of getFieldByName. So it didn't work earlier and it works now!
But looks like I have a problem displaying a table in the field. It must be a wiki renderer issue but am not able to fix that. The same script works for Description field and it shows a table but it doesn't display the table for the Service Request Details field. So issue is not with the script but with the field.
I've actually tried to put in a default value by configuring the custom field 'Service Request Details' itself. It worked it displayed table with content but it works intermittently - it doesn't display table and within few mins if I hit create issue button it again does display. The behavior script didn't even show the table once. Basically the Visual and Text tabs are not seen on the Service Request Details field unlike Description. Do you know how to turn that on?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also I want to know if we can display different contents in the Service Request Details field for one project when a different Request Type is chosen. Request type is a Dynamic Select (using Intenso Dynamic Forms) Custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding my query about Service Request Details field I have turned on the Wiki Renderer but it works on and off. Sometimes it displays a table and sometimes just as plain text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then I'd open a help request with ScriptRunner Support:
marketplacevendorsupport@adaptavist.com
Should you find out how to fix it, please, post the solution here so that other community members with the same problem can obtain the correct answer here.
Best regards
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.