How to target these fields "Resolution code" and "Resolution notes" of Incident form by using transform map ?

antoine_jouenne
Tera Contributor

Hello community,

I'm running into an issue, I have to import by using a transform map multiples records into [incident], it turned out some of them can't be created and the following message error appears "Data Policy Exception: The following fields are mandatory: Resolution code".

That said, I could expect this message because "Resolution code" is mandatory as soon as state is on "Resolved" and only tickets with this specific state couldn't achieve their way to the instance.

As far as I know, these two fields are part of the tab "Resolution Information" which lead me ask myself if they have to be mapped as I used to normally do but it seemed not.

Does anyone could help me?

Cheers

Antoine

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

it is because of this data policy which is OOB

Name: Make close info mandatory when resolved or closed

It is running on the Import Sets a well

If you want to skip this then uncheck that checkbox of

Apply to import sets - false

But remember from reporting point of view users will see empty resolution code and resolution notes for resolved incidents

Please set some default values from the field maps via the transform map

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

@antoine.jouenne@devoteam 

you need to get the import set field which holds that value

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

// Add your code here

var state = source.u_state; // use here the import set field which holds 6 or 7

if (state == 6 || state == 7) { // Resolved or Closed
target.close_code = 'Solved (Permently)';
target.close_notes = 'Closed from import set';
}

})(source, map, log, target);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader