Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
I have a javascript to pre-populate value for my custom field based on user log in, it works perfectly fine until the user change the project which has different context of the field. For example, user log in is in "inhouse" group, "Client" custom field (select list) change to "inhouse" value, then if user select another project which has the same context, the value is still the same. However, if user select another project which has different context (different select list value), the "Client" field is reset and my script does not reload again. Please advise how can I reload the script whenever user select different project? window.onload doesn't work from my understanding.
Thanks,
For dinamically loaded elements you can use jQuery.on function or jQuery LiveQuery plugin that depends of your purposes
jQuery(document).on('click', 'your field selector', handlerFunction).
Plenty more you can find in this blog : http://api.jquery.com/on/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey, it looks than more clean way use this function :
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
...
});
Try it, this one resolve many problems with dynamic reloading.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.