script
Audit
- Macro ID
- script
- Source
- XS
- Type
- Generator
- Classification reason
- Generator, like the other script macros: the output is what the script computes, far from the code typed in the content, which the reader never sees. The parameters only change how the script runs and how its output is processed.
- Status
- Reviewed
- Criteria version
- 15.20
- XWiki version
- 18.8.0
- Audit date
- 2026-10-20
- Auditor
- Compared macros
- velocity groovy
Sources
Where to gather the information the criteria are checked against, see Gather the sources.
| Other sources specific to this macro |
|---|
|
| Criterion | Result | Notes |
|---|---|---|
| D1 wording | OK | "Script" is the generic name of a macro that runs code in any JSR223 language, so it says what the macro does. The macro is audited as a developer macro, in the Development category. The French name is "Script" too, and the German one is "Skript". |
| D2 summary | OK | "Execute script in provided script language." says what the macro does, and for a generic script macro this is enough, like "Fetches information from a JIRA server". It does not say that the output of the script is inserted in the page as wiki syntax, which the output and wiki parameters tell. |
| D3 category | OK | only Development, where users look for a script macro, like html and velocity. |
| D4 quick-action | OK | Quick Actions finds the macro first for "script" and for the German "Skript", ahead of Groovy, PHP, Python, Ruby and Velocity. "execute script", "run code", "python script" and "run script" do not find it, and "groovy" finds only the Groovy macro. A technical macro named after its technology is OK even when few synonyms find it, like html. The French name is the same as the English one and the German one differs, so the name is checked in two languages. |
| L1 consistency | OK | compared with velocity and groovy, the other script macros, which also take a mandatory script as content: the Quick Action opens the Edit Macro dialog with a required Content text area, and the macro declares inline support. The wiki parameter defaults to true, like them, since the output of a script is wiki syntax. |
| L2 doc-parameters | KO | the parameters are documented only on the legacy extensions.xwiki.org page, https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Macro, not in the new documentation. The content is not documented as a parameter, the documentation states no default for language, and it documents the script bindings xwiki, xcontext, request, response, doc and services, which are not parameters. |
| L3 doc-example | OK | Example 2, a python script that renders "3", and Example 3, a groovy script that prints a list, show the common use and render without error. Example 1 is a syntax template with placeholder values, like in the velocity documentation, and does not count. Example 2 is used as the most common example, since no public XWiki Standard page call was found by the GitHub code search. |
| I1 pattern | OK | compared with the reference generator, children. The Script Quick Action opens the Edit Macro dialog with an empty Content text area, and the macro needs its script to do anything, so the dialog is OK, like include and the other script macros. |
| I2 zero-config | OK | submitting the dialog with an empty content keeps it open with no message, the generic behavior of the dialog for a mandatory value. A {{script/}} written in the source, or with an empty content, renders nothing with no error, which is the expected result of an empty script. |
| I3 instant | N/A | N/A for a generator. The Quick Action opens the Edit Macro dialog with an empty Content text area, see I1. |
| I4 cursor | N/A | N/A for a generator. After submitting the dialog, the macro widget is selected, and the script can only be changed through the dialog. |
| I5 focus | KO | the language is essential but not mandatory. Without it, {{script}}1+2{{/script}} does not run the script and renders the source text "1+2" as plain text, with no error. The Edit Macro dialog does not require it either, so a user can insert a macro that does nothing, like the jira server fields. |
| E1 wysiwyg | OK | with a script that prints text, the editor shows its rendered output, "3" for Example 2, the same as in view mode, also after reopening the page. A script with no output, like output="false" or only an assignment, shows the generic placeholder "macro:script" with no hint of the script. Recorded OK on the most common example, like velocity. |
| E2 errors | KO | invalid values are accepted silently. language with no value renders the source text as plain text, output="maybe" is read as false and the whole output disappears, wiki="maybe" is accepted, and an unknown parameter is ignored, the last one being generic. A wrong language, like "nosuchlanguage", "PYTHON" with a wrong case or "python ruby", gives the clear message "Can't find script engine with name [...]" that names the engine and not the parameter. A jars value with a missing attachment gives the same message about the python engine instead of the missing attachment, and "a.jar, b.jar" with a space gives it too, so the cause is wrong. A jars value that is not a URL gives "Failed to add JAR URLs to the current class loader for [notaurl]". |
| E3 nesting | OK | in a list item, a table cell and a box the macro renders its output with no error. The content is code, so a list, a table or a box typed as the script gives the syntax error of the script language, which is expected, and the technical message counts under E2. The content is not editable in place in any of these cases. |
| E4 inline-support | OK | the macro declares inline support, and its output renders inside a sentence with no block element. |
| E5 empty | N/A | N/A for a generator. The editor shows the output of the script, or "macro:script" when it is empty, and the content can only be typed in the Edit Macro dialog. |
| E6 inplace | N/A | N/A for a generator. The script is still edited only in a plain text area of 7 rows of the Edit Macro dialog, with no code editing aid, which is worth an improvement outside the criteria. |
Parameters
| Parameter | C1 clarity | C2 mandatory | C3 defaults | C4 input-assistance | C5 groups | C6 order | C7 alternatives | C8 advanced | C9 technical | C13 constraints | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $content | OK | OK | N/A | OK | N/A | OK | N/A | N/A | N/A | N/A | C1: the name "Content" and the description "The script to execute" are clear for a developer macro. C2: the content is mandatory, which is right, an empty script does nothing. C4: a plain text area in the Edit Macro dialog, counted under E6. C6: the content comes first, before the optional parameters. |
| jars | OK | OK | OK | KO | OK | OK | N/A | KO | OK | KO | C1: the description with its examples is clear for a developer macro. It says "List of JARs" without saying how to separate several values. The name is the ID. C3: empty means no extra JAR, which is the right default. C4, minor: a free text field for attachment references or URLs, with no picker, and a missing attachment is reported as a missing script engine, see E2. The values are free text, so the KO is minor. C6: the field comes first, before the language that the common example sets, but both are visible in the dialog without scrolling, so it is OK. C8: a rarely used parameter, set by no example of the documentation, and it is not marked as advanced. C9: the parameter belongs to the script macros and a script in python, groovy or another engine can need a library on its class loader, so it has a realistic use, even with no documented example. C13: a list of references in a single field with the separator undeclared: "a.jar, b.jar" is refused and the description does not say which separator to use. |
| language | KO | KO | OK | KO | OK | OK | N/A | OK | OK | N/A | C1, minor: the description "The identifier of the script language ("groovy", "python", etc)" gives examples of values, which is OK for a free field, but it does not say that an empty value runs nothing and shows the script as text, and that the identifier is case sensitive, "PYTHON" is refused. C2: the macro cannot do anything without it: with no language the script is not run and its source is rendered as plain text, see I5. It should be mandatory, so this is a KO. C3: the field opens empty and no single language is used in most cases, so no value is worth preselecting. Since it should be mandatory, an empty first field is OK. C4: a free text field for an identifier chosen among the script engines installed on the wiki, a select could offer them, and a wrong value is refused with a message about the engine, see E2. C5: four fields in the group, content included five, within the limit. C6: the field is second, after jars, and visible in the dialog without scrolling, so it is OK. C8: it is the essential parameter of the macro, so it is rightly not advanced. C9: realistic use, every example of the documentation sets it. |
| output | OK | OK | OK | OK | OK | OK | N/A | OK | OK | OK | C1: the description "Specifies whether the output result should be inserted back in the page" is understandable for a developer macro. The English name is the ID, "output". C3: the checkbox preselects the default, true. C4: a checkbox for a boolean. C6: no common example sets it, and it is visible in the group with only three other fields. C8: output="false" is the way to run a script that only sets variables, which is a frequent use, so it is not rarely used. Recorded like output of velocity. C9: realistic use, the examples of the documentation of the script macros set it. |
| wiki | OK | OK | OK | OK | OK | OK | N/A | KO | OK | OK | C1: the description "Specifies whether wiki syntax in the script execution result will be rendered or not" is clear for a developer macro. The English name is the ID, "wiki". C3: the checkbox preselects the default, true. C4: a checkbox for a boolean. C8, minor: wiki="false" is a realistic but rare use, for a script that outputs text with wiki characters, and the field is not marked as advanced. Recorded like wiki of velocity. C9: realistic use, for a script that outputs text with wiki characters. |
KOs and tickets
Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.
| KO | Criterion | Existing tickets | New tickets |
|---|---|---|---|
| L2 | L2 doc-parameters | XINFRA-525 | |
| I5 | I5 focus | XWIKI-25476 | |
| E2 | E2 errors | XCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25500 (partial), XWIKI-25579 (partial) | |
| C4:jars | C4 input-assistance, jars | XWIKI-25568 | |
| C8:jars | C8 advanced, jars | XWIKI-25476 | |
| C13:jars | C13 constraints, jars | XWIKI-25509 | |
| C1:language | C1 clarity, language | XWIKI-25475 | |
| C2:language | C2 mandatory, language | XWIKI-25476 | |
| C4:language | C4 input-assistance, language | XWIKI-23045 (partial) | XWIKI-25500 |
| C8:wiki | C8 advanced, wiki | XWIKI-25476 |
Tickets
| Ticket | Origin | KOs covered | KOs partly covered |
|---|---|---|---|
| XCOMMONS-3847 | New | E2 | |
| XRENDERING-823 | New | E2 | |
| XWIKI-25475 | New | C1:language | |
| XWIKI-25476 | New | C2:language C8:jars C8:wiki I5 | |
| XWIKI-23045 | Existing | C4:language | |
| XWIKI-25500 | New | C4:language | E2 |
| XINFRA-525 | New | L2 | |
| XWIKI-25509 | New | C13:jars | |
| XWIKI-25568 | New | C4:jars | |
| XWIKI-25579 | New | E2 |
Known issues of this macro
No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.
Lucas Charpentier