Resolve D7I tickets automatically
We receive an excel file with the tickets to be resolved, together with the snow number and the comment we need to add to the solution/close notes.
In order to do the task, we use import sets to load this data and apply a transformation map that will modify the corresponding ticket.
Manipulation on the excel file
- We create two sheets on the file, one with only requests and other with incidents.
Load data
- It will create a data source of type Excel. We will need to create two data sources, one for request and other for incidents.
Transformation map
- We create a transformation map associated to the data source (or reuse the existing ones such as 'Excel d7i incidents to be resolved 3-4-5'), with the transformation field for the ticket number (depends of how it is defined in the excel) with the coalesce attribute true.
- We will also need a transform script that runs onBefore to resolve the tickets. We need to change the field
source.<comments field>
each time, as it depends on the Excel column. Here it is an example to close requests (for incident is really similar, it is available in production):
/**
* Set the state close with no notification to the requests of the import set
*
* We cancel the workflow too.
*/
if (target.u_current_task_state != '9' && target.u_current_task_state != '10') {
var gr = new GlideRecord('u_request_fulfillment')
gr.get('sys_id', target.sys_id);
new Workflow().cancel(gr);
target.u_current_task_state = '10'; // closed
target.u_workflow_stage = 'Closed';
target.u_no_notification = true;
target.u_close_code = 'Other';
var messageSolution = 'Automatically closed by the system';
if (source.u_comments != '') {
messageSolution = source.u_comments;
}
if (target.u_solution == '') {
target.u_solution = messageSolution;
}
target.close_notes = messageSolution;
}
Run transformation
- Just run the two transformation map we have created and check the results.
Topic revision: r1 - 2011-05-10
- unknown