This service is named
scripts and allows you to write and run the business logic of your application.
To see the Scripts menu entry on the portal, you need to have the
If you have the
scripts=* permission, you can have access to all the functions mentioned below.
View the Scripts¶
To have access to all the Scripts, you need to have the
Otherwise, you cannot read the data.
If your permission has values like this:
scripts=read('Script 1', 'Script 2'), you will only see the Script 1 and Script 2 Scripts.
scripts=read permission, you will not be able to edit the resources.
You can view the resources of a Script by double-clicking on the line associated with this Script.
On the left, you have the list of resources and on the right the code editor.
A resource consists of a name, a type (Groovy, XML, HTML, XSLT, TEXT, TypeScript) and a content. By clicking on a resource’s name, you display the content in the code editor.
Run a Script¶
To run a Script, you need to have the
You can run a Script from the code editor’s tab. You will have at your disposal three buttons on the top right of the code editor to manage the Script running.
You can only run a Script if all your modifications on the resources have been saved.
This button allows you to display or hide the console below the code editor. This console shows the logs during the Script execution. It will automatically open at the start of the execution.
Add pipeline variables¶
This button displays a modal view, add or remove execution pipeline variables. Pipeline variables are not required and consist of a key (which cannot be empty) and a value. You can run your Script from this modal.
Start/Stop the execution¶
This button starts the execution of the script with any entered pipeline variables. Once started, the logs will be displayed in the shell, but you can stop the execution with the button Stop.
Edit the scripts¶
To edit the Scripts, you need to have the following permissions:
When a Script is created, it will create by default a Groovy resource, named
main. It will be your entry point when running the Script.
You can access to the code editor by double-clicking on a Script in the grid and with the
scripts=edit permission, you will be able to save your changes.
Edit a Script’s details¶
Click on the top right button Edit details. You will be able to update the Script’s name and description.
The Script’s name and the English description are mandatory and cannot be empty.
Edit a Script’s resources¶
Back on the main Edit tab, you can manage the Script’s resources. Thus you can:
- create a new resource
- rename a resource
- duplicate a resource
- delete a resource
None of the actions above is available for the main resource.
You can use the keyboard shortcut
Ctrl + s/
Cmd + s to save your changes in the code editor.
Adding a new resource will open a new tab with a form. You will be asked to choose a unique name and to select a type of your new resource.
To rename a resource, you need to double-click on the resource’s name in the list. An input will be displayed and you will be able to choose a new name.
To validate the new name, press Enter, otherwise click anywhere else. As for the script’s name, you will get a notification if the resource’s name is already taken.
To duplicate a resource, click on the resource’s name and click on the button Duplicate. A new resource based on the initial resource will directly be created. Only, the name will be indexed.
To delete a resource, click on the resource’s name and click on the button Delete. You will be asked to confirm the deleting.