Reclassification field maps
Fields of the reclassification field map, the maps Servicely ships, and examples of copying fields, journals, attachments and statuses between records.
A reclassification field map says which data is copied when one record is created or updated from another, for example when an incident is converted to a request. This page lists the map’s fields, the maps Servicely ships and worked examples, for administrators who change what is copied.
Maps are under Administration → Configuration → Reclassification field map. Users with application_administrator or configuration_administrator can edit them. Because the buttons read the maps, you change what is copied by editing maps, not scripts. To use maps for a new pair of tables, see Create a record from another record.
Reclassification field map fields
| Field | Type | Behaviour | Purpose |
|---|---|---|---|
| Name | Text | Read only. Built from the other fields. | Identifies the map. The format is shown below the table. |
| Active | Yes or no | Default yes. | Only active maps are applied. |
| Unique map | Text | Optional. | Groups maps for one use of a source and target pair, such as FirstContactResolved. Maps with an empty value are the default set. |
| Source table | Table | Required. | The table the data comes from, by name, for example Interaction. |
| Source field | Field | Optional with Advanced script. | The field the data comes from, by name, not label. |
| Target table | Table | Required. | The table the data goes to, for example Incident. |
| Target field | Field | Optional with Advanced script. | The field the data goes to, by name. |
| Special type | Choice | Attachment, HTML or Journal. Required for those field types, or the data is not written correctly. | Handles fields that are not plain values. |
| Method | Choice | Copy or Move. Used with Special type. | Copy leaves the data on the source. Move removes it from the source. |
| Advanced script | Yes or no | Shows Script. | Switches from a field copy to a script. |
| Script | Script | Receives sourceRec, sourceTable, targetRec and targetTable. The returned value goes into Target field. Load a script library with require. |
Calculated values, or logic that writes nothing to one field. |
Name takes the form <Unique map> - <Source table> | <Source field> > <Target table> | <Target field>. Empty parts are left blank, and [Attachment] follows a field for attachment maps. For example: FirstContactResolved - Interaction | ClientJournal > Incident | ClientJournal.
Shipped maps
| Source table | Target table | Unique map | Used by |
|---|---|---|---|
| Interaction | Incident, ITSMRequest, HRCase | Empty | Classify interaction |
| Interaction | Incident, ITSMRequest, HRCase | FirstContactResolved | Set to resolved on an interaction |
| Interaction | Incident, ITSMRequest, HRCase | ZeroContactResolved | Records created without an agent |
| Incident | ITSMRequest | Empty | Converting an incident to a request |
| ITSMRequest | Incident | Empty | Converting a request to an incident |
| Incident, ITSMRequest, Problem | Change | Empty | Creating a related change |
| Incident | Problem | Empty | Creating a problem from an incident |
| Incident, ITSMRequest, HRCase | Knowledge | Empty | Creating a knowledge article |
| Incident | Knowledge | MajorIncident | Creating an article from a major incident [UNVERIFIED] |
| Problem | Knowledge | KnownError, Workaround | Creating a known error or workaround article [UNVERIFIED] |
The ITSM Ticket application adds maps from Ticket to Change, Problem and Knowledge. Work Tracker adds a map from WorkTrackerItem to Change. What the interaction buttons copy is described in How classification and resolution work.
Examples
These maps are applied by Set to resolved on an interaction whose work type is Incident, so each has Source table Interaction, Target table Incident and Unique map FirstContactResolved.
| Example | Source field | Target field | Special type | Method | Advanced script |
|---|---|---|---|---|---|
| Copy one field | ShortDescription | ShortDescription | No | ||
| Set the target’s status | WorkflowStatus | Yes | |||
| Copy a multiple reference field | Yes | ||||
| Set a value by script | FirstContactResolved | Yes | |||
| Copy journal entries | ClientJournal | ClientJournal | Journal | Copy | No |
| Copy the journal’s attachments | ClientJournal | ClientJournal | Attachment | Copy | No |
A plain field copy also works for a single reference field.
Set the target’s status
This script runs the new-to-resolved transition on the new incident. The script library must be loaded with require.
let WorkflowUtil = require("WorkflowUtil");
WorkflowUtil.updateWorkflowStatusFromTransition(targetRec, "new.resolved");
Copy a multiple reference field
A multiple reference field uses the names on its relationship definition. This script copies the interaction’s followers to the incident.
let followerArr = sourceRec.getRelation("Follower").map(it => it.ID());
followerArr.forEach(function (follower) {
Table("WorkFollower").newRecord().Work(targetRec.getID()).User(follower).create();
});
Set a value by script
The returned value goes into Target field:
return true;
Copy journal entries and their attachments
Journals need two maps on the same field. The Journal map copies the entries. The Attachment map copies the files attached to them. Without it, the copied entries point at the source record’s attachments, which the reader may not be allowed to see. Mapping per field copies only the entries and files of that journal.