Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix our user macro that uses java script?

Alfredo Lagrosa
September 24, 2024

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.
UserMacro_ITTemplate.JPG

1 answer

0 votes
Prasanna Ravichandran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 18, 2026

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.5.14
TAGS
AUG Leaders

Atlassian Community Events