Jira Custom Field Script Not Running on Page Load in Jira v8.5.9

Jira custom multi-select wiki field style script fails on load yet functions via console.

<script>$(document).ready(() => {$("#cfRow").css("width", "125%");});</script>

hey, i’ve seen this happen in v8.5.9. try delaying your css change with a setTimeout call. sometimes the field takes a sec longer to load, so giving it a tiny pause might let your script work.

I encountered a similar problem where the custom field wasn’t available at the time the document.ready event fired. In my experiments, an approach that worked well was to continuously poll for the field’s presence using a simple loop combined with a small delay. This allowed me to ensure that the field was truly rendered before I applied any changes. After a few iterations, I got it working reliably. It seems that sometimes the asynchronous behavior of Jira, especially in v8.5.9, can really affect when and how scripts interact with these fields.

In my experience, the problem likely stems from Jira’s asynchronous loading, which can cause the custom field element to be unavailable when document.ready fires. I resolved a similar issue by switching to Jira’s initialization framework. Specifically, I replaced the jQuery document.ready call with AJS.toInit, which ensured that the custom field had been fully rendered before applying any style changes. This approach consistently ensured that the element was accessible when the script ran, and it worked seamlessly with our Jira v8.5.9 instance.