AI prompts
The fields of an AI prompt, its test buttons, the script calls that run it and the prompts Servicely ships.
An AI prompt is a single call to a language model with templated prompts, used for jobs such as summarising a ticket, classifying an email or drafting an article. This page lists its fields, how to test it and how to run it from a script. Some AI features have licensing implications, so check with your account manager before you build on them.
Prompt fields
Prompts are in the Administration workspace under AI assistants & agents → Building blocks → AI Prompts.

| Field | Type | Required | Behaviour | Purpose |
|---|---|---|---|---|
| Name | String | Yes | Shown in lists. | Identifies the prompt. |
| Key | String | Yes | Must be unique. | The value scripts use to run the prompt. |
| Description | Text | No | None. | Says what the prompt does. |
| Model selection type | Choice | No | Explicit, Fast, General, Complex or Coding. Explicit uses LLM Model, the others use the model set for that type. | Chooses the model. |
| LLM Model | LLM model | No | Used when the type is Explicit. Change it to compare providers and models. | The model, provider and token. |
| System Prompt | Text | No | Markdown. Can reference ${variableName} and templates. |
Sets the model’s role, context, limits and output format. |
| User Prompt | Text | No | A template sent with each call. ${variableName} values come from the context. |
The task you ask the model to do. |
| Pre-processing Script | Script | No | Runs before the call. Receives context, options, promptRec and evaluationPhase (evaluate or test). |
Reads Servicely data into the context for the templates. |
| Post-processing Script | Script | No | Runs after the response. Receives context, promptRec and evaluationPhase. |
Checks or reshapes the response before it is returned. |
| Test Setup Script | Script | No | Assigns sample values to answer. |
Supplies test input for the test buttons. |
| Execution Mode | Choice | No | On the Advanced tab. Synchronous by default. Async runs as a background job and pushes the result back. Background runs without waiting and shows a message when done. | How the prompt runs from the interface. |
| Timeout (Seconds) | Integer | No | On the Advanced tab. Overrides the default of 120 seconds. | Limits how long a call may take. |
| Roles | Roles | Yes | Required on the form. A prompt with no roles cannot be run from the interface. | Who can run the prompt. |
| Active | Boolean | No | Defaults to true. An inactive prompt cannot be run. | Turns the prompt on or off. |
| Condition | Script | No | A server-side script. When it returns false, the prompt is not offered and a direct call is refused. Empty means always available. | Limits when the prompt can run. |
| Rule Sets, Rules | AI rules | No | On the Rules tab. Enforced only when ai.rule.enforcement.enabled is on. |
Adds behavioural rules to the prompt. |
| Production Restricted | Boolean | No | A direct call to a restricted prompt is refused on a production instance, and on any instance not identified as development, demo, sub-production or staging. | Keeps test and build prompts off production. |
| Allow Additive Config | Boolean | No | Lets you add text to a shipped prompt without changing it. | Extends a shipped prompt. |
Test buttons
| Button | What it does |
|---|---|
| Test prompts only | Runs the pre-processing and shows the system and user prompts that would be sent, with a Copy button. Nothing is sent to the model. |
| Test Model | Sends the request to the model and shows the result, the model, the latency, the token usage and the cost. |
Both buttons use the Test Setup Script for their input.
Script methods
The AI script global runs prompts from server-side scripts.
| Method | Returns | Description | Version |
|---|---|---|---|
AI.processAIPrompt(key, context) |
Any | Runs the prompt with this key and returns what the post-processing script returns. Roles are not checked. | 1.9 |
AI.processAIPrompt(key, context, enforceRoles) |
Any | As above. When enforceRoles is true, the caller must hold one of the prompt’s roles. |
In 1.11 |
AI.processAIPrompt(key, context, options) |
Any | Options are enforceRoles and forRecord, the record the usage log is attributed to. |
In 1.11 |
AI.processAIPromptAsync(key, context, options) |
String | Starts a background run and returns the AI prompt execution ID. Options include forRecord, runAs and notifyUser. |
In 1.11 |
Example
This server-side script summarises the current incident with a prompt whose key is itsm_inc_rec_summarisation.
var summary = AI.processAIPrompt(
"itsm_inc_rec_summarisation",
{ current: current },
{ forRecord: current }
);
Shipped prompts
Platform
| Prompt | Key | What it does |
|---|---|---|
| Translation | prompt_translation |
Translates text when the source and target languages are known. |
| Translation with autodetect | prompt_translation_autodetect |
Translates text and detects the source language. |
| Translation for language pack | prompt_translation_pack |
Generates language packs. |
| Major Incident Teams Chat Summarisation | major_incident_teams_chat_summarisation |
Summarises the chat in a major incident’s Microsoft Teams channel. |
| Test Generate Major Incident Chat Messages | test_generate_major_incident_chat_messages |
Generates a sample major incident chat for testing. |
| Test | prompt_test |
A test prompt. |
| Record Cluster Label | RecordClusterLabel |
Names a cluster of similar records and writes a short summary, for cluster analysis. |
| AI Rule Scope Gate | prompt_ai_rule_scope_gate |
Checks an inbound message against an AI record’s enforceable rules, so an out-of-scope request is refused. |
AI Accelerator — ITSM
| Prompt | Key | What it does |
|---|---|---|
| ITSM - Incident and Request Summarization | itsm_inc_rec_summarisation |
Summarises an incident or request for the people working it. |
| AI Journal Composition | ai_journal_composition |
Rewrites an agent’s draft customer update as a clear message. |
| AI Internal Note Composition | ai_internal_note_composition |
Rewrites an agent’s rough internal note as a clear working record. |
| Draft Knowledge Article | draft_knowledge_article |
Expands a rough draft into an article, using the closure notes of a linked ticket. |
| ITSM - AI First-Reply | itsm_ai_first_reply |
Decides whether a new ticket has enough information and, if not, writes a short reply asking for it. |
| ITSM - AI Auto Classification | itsm_ai_auto_classification |
Decides whether an inbound message is an incident, a request or an HR case, and where it should go. |
ITSM events and alerts
| Prompt | Key | What it does |
|---|---|---|
| ITSM Event - AI Triage Enrichment | prompt_itsm_event_ai_enrichment |
Suggests a corrected severity and configuration item for a new event. |
| ITSM Event - AI Triage Suppression | prompt_itsm_event_ai_suppression |
Decides whether an event is noise to suppress. |
| ITSM Event - AI Triage Correlation | prompt_itsm_event_ai_correlation |
Decides whether an event belongs to an open alert. |
| ITSM Alert - AI Triage Enrichment | prompt_itsm_alert_ai_enrichment |
Suggests a severity and a triage summary for an open alert. |
| ITSM Alert - AI Triage Suppression | prompt_itsm_alert_ai_suppression |
Decides whether an alert is noise to suppress. |
| ITSM Alert - AI Triage Escalation | prompt_itsm_alert_ai_escalation |
Decides whether an alert needs an incident, or belongs to an open one. |
Project Portfolio Management
These prompts ship with Project Portfolio Management, a licensed application.
| Prompt | Key | What it does |
|---|---|---|
| PPM Status Report Commentary | prompt_ppm_status_report_narrative |
Writes the overall commentary of a weekly project status report. |
| PPM Project Summary | prompt_ppm_project_summary |
Writes an executive summary of a project, with metrics, bottlenecks and risks. |
| PPM Idea Summary | prompt_ppm_idea_summary |
Summarises an idea for the people who assess it. |