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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.