---
title: "Groovy macro"
canonical: "https://support.appfire.com/space/SCRP/73728611/Groovy%20macro"
format: markdown
---
> Macro (aura-html)

  


## Description

> Macro (excerpt)
> 
> Java scripting using [Groovy](http://groovy-lang.org/)

## Documentation

- Help available in the notation guide.

## Parameters

- See [Macro parameters](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728435)

### Pre-defined variables

- See [Pre-defined variables](https://appfire.atlassian.net/wiki/spaces/SCRP/pages/73728439)

## Usage

```
{groovy}
println("Hello world");
{groovy}
```

```
{groovy:output=wiki|script=#example.py|var1=test}
{groovy} 
```

```
{groovy:var1=hello|var2=world}
print "Output parameter"
print var1 + var2
out.println(var1 + var2)
{groovy}
```

### **classpath example**

```
{groovy:classpath=/sde/tools/gint-1.5.0.jar}
...
{groovy}
```

### Using the HTML markup builder

```
{groovy}
def list = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]
html.table(class: 'confluenceTable') {
  tbody {
    list.each { row ->
      tr {
        row.each { column ->
            td(class: 'confluenceTd', column)
        }
      }
    }
  }
}
{groovy}
```

## Security

To mitigate potential security risks and prevent unauthorized system-level access, the app performs user input validations and allows administrators to restrict script execution to trusted users or groups.

## **User input validations**

Dynamic script execution is restricted to safe and validated input. The user inputs are sanitized across all dynamic code execution entry points.

The validation mechanisms are followed to:

- Restrict the use of high-risk Java classes
- Prevent the invocation of dangerous methods
- Protect against misuse of critical system methods
- If the Groovy macro script includes the high-risk classes and methods, the app throws an error.

## **Restrict script execution to trusted users or groups**

The macro supports [Macro Security for Confluence](https://appfire.atlassian.net/wiki/spaces/CMSP), allowing administrators to restrict script execution to trusted users or groups. This ensures that only authorized individuals can run scripts within the macro.