I would like to set a description template for only one JIRA project (create issue).
To make it flexible I would like the description to toggle between empty "" or the template such as:
Some
Stuff
On several lines
depending on which JIRA project is selected at create issue or do nothing if the description contains something else already.
I tried to update the following velocity file:
<jira-application-dir>/atlassian-jira/WEB-INF/classes/templates/jira/issue/field/description-edit.vm
with this very simple code before rendering the field:
#set ($template = "Put
stuff
here:")
#if ($issue.project.key && $issue.project.key == "TTT")
#if ($description == "")
#set ($description = $template)
#end
#elseif ($description == $template)
#set ($description = "")
#end
## let the renderer display the edit component
But if the project is not TTT, even if the description matches the template, the string comparison does not return true. Please note it returns true if the template contains only "One line:".
I'm running with JIRA 6.1. Can anyone help me?
PS: I also tried a javascript but it fails to execute in every situation.
At least the velocity script fires in every situation but the comparison fails.