# Writing validation messages

{% hint style="info" %}
Validation message expression must evaluate to String
{% endhint %}

Enter text surrounded by quotation marks to provide a static message:

{% code lineNumbers="true" %}

```javascript
"Issue must be assigned!"
```

{% endcode %}

You can add some dynamic content, simply by concatenating strings. Remember to use `?.` notation to prevent syntax errors when a property is null.

{% code lineNumbers="true" %}

```javascript
"Issue can't be assigned, but got: " 
  + issue.assignee?.displayName 
```

{% endcode %}

Use [template literals](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/#template-literals) for more complex use cases:

{% code lineNumbers="true" %}

```javascript
`Issue ${issue.key} must have at least 1 comment,
 but got: ${issue.comments.length}!`
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forgappify.com/workflow-building-blocks-for-jira/writing-jira-expressions/writing-validation-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
