On 24/04/2023 19:29, Jiahao Song wrote:
Hi Team,
I’m modifying the .vm files in my JIRA email template folder and I’d
like to give you some context before asking my questions. We use Jira
8.20.12 Data Center version and we’d like to modify the email
templates. However, we could not see the changes unless we restart the
Jira instance.
Another approach is that we download the .zip folder of the email
templates, modify the files, save them, and upload the .zip file back
to Jira, which we found somewhat cumbersome and not good for version
control.
We tried yet another approach which is documented on Atlassian doc
<https://confluence.atlassian.com/adminjiraserver0820/customizing-email-content-in-jira-server-1095777454.html>:
“On a development instance, you pick up velocity file changes without
restarting Jira. From
<jira-install>/atlassian-jira/WEB-INF/classes/velocity.properties:
Change class.resource.loader.cache from true to false
Remove the comment sign (#) from #velocimacro.library.autoreload=true
On a production instance, this change allows you to go back to default
Velocity templates and make changes in them without restarting Jira.”
However, we found this approach not working and Atlassian Support told
us it’s because we are sitting on a Data Center version.
From what I understand, it seems that the Data Center version is
somehow filtering your Velocity configuration.
So here are my questions if all the above make sense to you:
1. Can you directly disable the cache in the velocity template?
You mean, from the template itself, to try to work around this
configuration issue? If you can plug in custom tools, maybe you can try
to alter the Velocity configuration to hack Jira, but the currently
rendering template won't be affected since already loaded, maybe this is
a negligible side effect.
2. Is there a command that we can use to clear the cache?
The ResourceCache interface has a clear() method.
3. Is there a way to restart the velocity engine without restarting
the Jira instance?
If Jira doesn't provide it itself, no.
Regards,
Claude
Best,
Jiahao
*Jiahao Song*
Technical Specialist | InterSystems
Direct: +1.617.370.4529
InterSystems.com <http://www.intersystems.com/>