Issue Summary
The FreeMarker allowlist freemarker-allowlist.properties does not include UnknownTriggerReason.getName(). When a build has no trigger reason key in its custom data, the system falls back to UnknownTriggerReason. The template unknownTriggerReason.ftl then calls .getName(), which is blocked by the allowlist.
Steps to Reproduce
N/A
Expected Results
Actual Results
The below exception is thrown in the atlassian-bamboo.log file:
WARN [BambooFreemarkerAllowlistBeansWrapper] Forbidden method invocation: com.atlassian.bamboo.v2.build.trigger.UnknownTriggerReason.getName()
ERROR Error executing FreeMarker template freemarker.core._TemplateModelException: An error has occurred when reading existing
sub-variable "name"; see cause exception!
Failed at: ${(triggerReason.name)!"Unknown trigg...
[in template "com/atlassian/bamboo/build/triggerReasons/unknownTriggerReason.ftl" at line 1]
Caused by: java.lang.IllegalAccessException: Forbidden method invocation:
com.atlassian.bamboo.v2.build.trigger.UnknownTriggerReason.getName()
Workaround
1. Take a backup of <BAMBOO_INSATLL_DIR>/atlassian-bamboo/WEB-INF/classes/freemarker-allowlist.properties
2. Add the below method to the end of the file like below:
,\ com.atlassian.bamboo.v2.build.trigger.UnknownTriggerReason.getName()
3. Restart the Bamboo