Instruction
Using a script
When a ticket changes to the status 'Solution provided', the script checks if the ticket comments contain specific text.
Depending on the result, an internal comment with appropriate content is created in the ticket.
The search text and corresponding content are passed in the additional script context.
-
Log in to Swarmica as an administrator
-
Create a script with the Admin role in Settings - Scripts:

and on the opened page, add the script trigger_autonote.py
- Create an Action by Event in Settings - Actions by Event and select 'Script' as the event:

- On the opened page, select the script added in step 2 and add conditions:
Event type = Ticket status changed
New value = Solution provided
- In the 'Add data to context' field, enter the following:
{
"text": <TEXT>,
"comment_if_text": <COMMENT_CONTENT_1>,
"comment_ifnot_text": <COMMENT_CONTENT_2>
}
<COMMENT_CONTENT_1> - New comment text if the desired text is found in the ticket's internal comments
<COMMENT_CONTENT_2> - New comment text if the desired text is NOT found in the ticket's internal comments
- Change 'Status' to 'Enabled' and click 'Save'
It should look like this:

Using a macro
-
Log in to Swarmica as an administrator
-
Create a macro with the Admin role in Settings - Macros
-
In JSON mode, enter 'Name' and 'Data' like this:
{
"public": false,
"comment": <p>{% if event.ticket.comments.filter(body__icontains='<TEXT>', public=False).exists() %} <COMMENT_CONTENT_1> {% else %} <COMMENT_CONTENT_2>{% endif %}</p>,
"subject": "notification"
}
<COMMENT_CONTENT_1> - New comment text if the desired text is found in the ticket's internal comments
<COMMENT_CONTENT_2> - New comment text if the desired text is NOT found in the ticket's internal comments
- Create an Action by Event in Settings - Actions by Event and select 'Macro' as the event:

- On the opened page, select the created macro and add conditions:
Event type = Ticket status changed
New value = Solution provided
- Change 'Status' to 'Enabled' and click 'Save'