Hi I just created a button using Script fragment. I want to run a certain script on clicking the button is it possible?
Yes, your button will have to be linked to a scriptrunner custom REST endpoint and that endpoint will run your code.
The easiest option is to select "run code and show a flag" in your web item fragment, then your rest endpoint just has to return a flag map to show the result of running your script.
Of course, you could always create your own javascript to react to the button click and call your rest endpoint.
Hey thanks for your answer, but I'm new to jira and script runner. Can you please explain how to link the button to an endpoint and run the code?
There are some examples here: https://docs.adaptavist.com/sr4js/6.24.0/features/script-fragments/custom-fragments/web-item
Thanks for your help
It looks like you're new here. Sign in or register to get started.