Updated code.js for incident tagging logic to track caller-driven comment updates #1854
+33
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
README.md
📌 Description
This Business Rule automatically manages a tag (label_entry) on an incident record based on who updated the Additional Comments field.
🔹 If the caller (the person who opened the incident) adds a comment, the rule adds a specific tag (e.g., “Caller Responded”) to the record.
🔹 If anyone else (e.g., an agent, fulfiller, or system user) adds or modifies the comment, the tag is removed.
This tagging mechanism provides a visual indicator of caller activity on the ticket. It's particularly useful in:
📊 Triage scenarios — agents can quickly identify incidents that require follow-up because the caller re-engaged.
📈 Reporting — teams can track caller interaction trends for SLA monitoring or customer responsiveness.
🧠 Queue management — prioritize incidents where the customer is actively responding.
The script uses the label_entry table to associate or remove a predefined tag, depending on whether the sys_updated_by value matches the incident's caller_id.