To address the delay in response caused by two dependent custom fields in Jira,
Here the question is: "How can I execute the JavaScript code within ScriptRunner Behaviours to manage the loader option, considering that two custom fields are interdependent?"
"What?" What delay.
You don't run js directly off behaviours. They do "trigger certain javascript" on issue forms, but you are writing groovy scripts, not javascript.
Thanks for your reply @Radek Dostál
I've established two custom fields with interdependencies, and for the initial field, I'm using a Groovy script to invoke an API. However, due to a delay in the API response, I'm looking to implement a loader icon or spinner. My current approach involves executing JavaScript code within the Groovy script to keep a loader icon.
Alternatively, if you have any other suggestions for incorporating a loader icon or spinner, I'm open to exploring alternate approaches.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Radek,
you can actually use Fragments and Groovy, to write JavaScript in scriptrunner. You only need to pass the JavaScript or html to the writer.write function. I’ve built lots of custom web panels using this approach.
writer.write(“””
<script>
function myfunction(){
alert(‘Hi Mom!’);
}
</script>
<button onclick=“myfunction()”>Greeting</button>
”””) // all this happens in the write function 🤫🤔
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!
Register today
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.