# Printing AST to JQL string

Consumers can generate a formatted JQL string from an AST object using the print API. This is particularly useful in
conjunction with the [transformation API](transformation.md) to modify a tree and print the resulting output.

Usage is simple:

```
import { creators, print, JastBuilder, OPERATOR_EQUALS, COMPOUND_OPERATOR_AND } from '@atlassianlabs/jql-ast';

const input = 'status = open';
const jast = new JastBuilder().build(input);

const newClause = creators.terminalClause(
    creators.field('assignee'),
    creators.operator(OPERATOR_EQUALS),
    creators.functionOperand(creators.functionString('currentUser'))
);
jast.query?.appendClause(newClause, COMPOUND_OPERATOR_AND);

console.log(print(jast));
// Outputs: status = open and assignee = currentUser()
```
