Hi,
today I started my instance of JIRA 6.
In the create dialog there is now HTML displayed instead of a real textbox. I added a picture of the displayed result.
When I display the HTML source code I see that the tags (< and >) have the false markup (< and >). Of course the browser is now ignoring this tags. But the question is why this is so. I edited the description template (description-edit.vm).
Between "$!rendererParams.put("wrap", "virtual")" and "#if ($mentionable)" I added this:
#if($description == '')
#set ($description = "*Initial behaviour:*\
--------------------------------------------------------------\
\
--------------------------------------------------------------\
\
*Real behaviour:*\
--------------------------------------------------------------\
\
--------------------------------------------------------------\
\
*Expected behaviour:*\
--------------------------------------------------------------\
\
--------------------------------------------------------------\
\
*Comment:*\
--------------------------------------------------------------\
\
--------------------------------------------------------------")
#set ($description = $description.replace('\',' '))
#end
Full fill: http://pastebin.com/cK4bMsv6
The line endings are marked as \n like the oroginal file. No other changes are made of any JIRA file. As the renderer the wiki renderer is set which is also activated.
Does anybody know how to solve this?
Tanks in advance!
The answer was in the first line!
If you have a look at the Link to pastebin you can see that the line #disable_html_escaping() was changed to ##disable_html_escaping() TODO REENABLE.
This line was commented and - of course - not executed. That means: HTML escaping was turned on. And I feel a little bit dumb because I added a remark to reenable that. Well, I think the weekend was not very good for my memory :-D
The custom fields were a good answer, but we don't need that feature.
Additionally I want to provide this Link for you (in german) where the use of $issue in combination of Apache velocity with the JIRA template is described. Unfortunatly there was no documentation about that but I'm not sure if it belongs to JIRA or Apache velocity documentation.
Here is my full template. The goal was to provide two differen templates when an issue is created. When changed to "Feature Request" the other template should be shown. If an issue already existed the description should not be overwritten.
#disable_html_escaping() #customControlHeader ($action $field.id $i18n.getText($field.nameKey) $fieldLayoutItem.required $displayParameters $auiparams) ## setup some additional parameters $!rendererParams.put("class", "long-field") $!rendererParams.put("rows", "12") $!rendererParams.put("wrap", "virtual") #if(!$issue.isCreated()) #set ($description = "*Initial behaviour:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------\ \ *Real behaviour:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------\ \ *Expected behaviour:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------\ \ *Comment:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------") #set ($description = $description.replace('\',' ')) #if ($issue.getIssueTypeObject().getName().equals("Feature Request")) #set ($description = "*Goal:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------\ \ *Current situation/purpose:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------\ \ *Assumptions changes/ToDo's:*\ --------------------------------------------------------------\ \ --------------------------------------------------------------") #set ($description = $description.replace('\',' ')) #end #end #if ($mentionable) $!rendererParams.put("mentionable", true) #if ($issue.project.key && $issue.project.key != "") $!rendererParams.put("data-projectkey", "$!issue.project.key") #end #if ($issue.key && $issue.key != "") $!rendererParams.put("data-issuekey", "$!issue.key") #end #end ## let the renderer display the edit component $rendererDescriptor.getEditVM($!description, $!issue.key, $!fieldLayoutItem.rendererType, $!field.id, $field.name, $rendererParams, false) #customControlFooter ($action $field.id $fieldLayoutItem.getFieldDescription() $displayParameters $auiparams)
Hi AUser, welcome to Atlassian Answers!
I recommend reverting the changes to the template and using a different approach for solving your problem:
* Create new custom fields for Initial behaviour, Real behaviour, Expected behaviour. This way you have separate fields that you can make required, search on, etc. (More information on adding custom fields: https://confluence.atlassian.com/display/JIRA/Adding+a+Custom+Field)
* Add the placeholder text by using Javascript in the description of the custom field, eg:
<script> if (AJS.$("#description-wiki-edit textarea").text() === "") { AJS.$("#description-wiki-edit textarea").text("Initial Behaviour \n etc etc"); } </script>
These solutions are less likely to break your instance, especially when upgrading :-)
Cheers,
Tom
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.