a!update(): resolve a support ticket
Medium
Resolving a support ticket sets its status to "Resolved" and records who resolved it in resolvedBy, in one call. Every other field, the id and the subject included, must survive untouched.
A ticket that is already resolved keeps its original resolver: return it unchanged.
Inputs
ri!ticket— Mapri!agent— Text
ri! Rule Inputs
ri!ticketMapa!map(id: 7, status: "Open", subject: "Cannot log in")
ri!agentText"Ann"
Example 1 — An open ticket
Input: ri!ticket
a!map(id: 7, status: "Open", subject: "Cannot log in")
Input: ri!agent
"Ann"
Output:
a!map(id: 7, status: "Resolved", subject: "Cannot log in", resolvedBy: "Ann")
Example 2 — Already resolved by someone else
Input: ri!ticket
a!map(id: 8, status: "Resolved", subject: "Refund", resolvedBy: "Bo")
Input: ri!agent
"Ann"
Output:
a!map(id: 8, status: "Resolved", subject: "Refund", resolvedBy: "Bo")
Example 3 — Reopened, then resolved again
Input: ri!ticket
a!map(id: 9, status: "Reopened", subject: "Slow page", resolvedBy: "Bo")
Input: ri!agent
"Ann"
Output:
a!map(id: 9, status: "Resolved", subject: "Slow page", resolvedBy: "Ann")
Appian Expression Tips
- • Use
ri!variableNamefor rule inputs - • Use
a!localVariables(local!x: …, body)for locals - • Use
a!forEach(items: …, expression: fv!item)to iterate - • Use
where()/reject(fn!isnull, list)to filter