Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I manually excecute a custom Scriptrunner Script with a text parameter outside the Console

Ricardo Martinez
Contributor
November 23, 2020

I have ScriptRunner for Jira and use it for many things, validators, post-functions, Listeners, etc.

 

I also have a custom, quite long and complex ScriptRunner for Jira script developed in the console.

Whenever I want to execute it with certain text parameters, I have to copy it from a local file, paste it in the console, type the parameter in the actual code and then run it. (image 1)

 

Is there any other way?

 

Can I save the script somewhere and have it executed with a manual parameter field that then sends this to the script? 

 

I imagine some kind of page like the ones in "Built-In Scripts", for example the "Config exporter"  where it has a text parameter field called "Base path for output" and then you have the Run button that executes something on the back using this parameter, then displays the result. (Image 2)

1 answer

1 accepted

0 votes
Answer accepted
Hana Kučerová
Community Champion
November 23, 2020

Hi @Ricardo Martinez ,

I believe Script Editor with the usage of Dynamic Forms could do the trick.

You can send the saved code in the console and have some parameters available.

Ricardo Martinez
Contributor
December 3, 2020

Hi

 

Can you elaborate on how to achieve this? using editor and Forms, how?

What would be the process like?

I mean, I am using the @annotatios  for my script to have parameters, but that only works in the console.

In the 'Script Editor', the Dynamic Forms with the parameters defined in the script do not appear in the page as fields. I am assuming this is because of the reason bellow.

Also you can not execute a script saved in the Script Editor. So I would need to copy into the console, for the fields to appear and script to be executed...or is there any other way?

Ricardo Martinez
Contributor
December 3, 2020

I have just found the way, I believe this is what you meant.

 

If you save the script and then go in the console, you can search for it in the console, as File and there you can see the parameters and execute the script.

 

I believe this will do the trick.

 

Thanks

Hana Kučerová
Community Champion
December 3, 2020

@Ricardo Martinez Yes, great!

Like Ricardo Martinez likes this

Suggest an answer

Log in or Sign up to answer