Hi,
Need help resolving why our user macro that uses JavaScript jQuery code to add an event listener to an input field that no longer works.
what we want it to do,
Event Listener: wait for changes to an input field with the name variableValues.replaceme.
Logging: When the value of this input field changes, it logs the new value to the console.
Updating Title: retrieve the current value of an input field named title within a form named filltemplateform.
Modifying Title: It updates the title input field by appending the new value from the variableValues.replaceme input field to the existing title, separated by a hyphen.
In essence, this script dynamically appends the title of a form based on the changes made to the input field. What do we do to enable this macro again?
I'm guessing this macro has not worked since https://jira.atlassian.com/browse/CONFSERVER-82741.
I have tried the workarounds below, but, they did not work: adding the system property to tomcat java options,
-Dmacro.required.velocity.context.keys=generalUtil,bootstrap,action
-Dmacro.required.velocity.context.keys=comma,seperated,key,values
Macro Body Processing: No macro body
Having trouble posting the template script, so screen pic attached.
Hi,
Just sharing my suggestion below.
User macros with JavaScript often stop working due to security changes that block inline scripts. The code is likely being sanitized.
Workarounds:
• Move the JavaScript to a custom HTML/JS file or app
• Use an approved app (e.g., ScriptRunner / Custom UI macro)
• Ensure jQuery is available on the page
• Wrap code to run after page load
• Check browser console for blocked script errors
Inline JS in user macros is restricted in newer versions for security.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.