- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 02:53 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 02:59 AM
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
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 02:57 AM
Hi,
please check the data policy on incident table.
it is restricting it because you are setting the value when you are trying to resolve it via transform map
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 02:59 AM
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
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 03:04 AM
Hi,
use onBefore transform script with sample below
give the close_code value you want - I just gave this
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
target.close_code = 'Solved (Permanently)';
target.close_notes = 'Closed from import set';
})(source, map, log, target);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 05:32 AM
Hi Ankur,
Thanks for your prompt reply. Tell me if I get wrong but if I copy/paste your script, no matter the value of my state, it will fill every resolution code and resolution note fields, right?
Based on your script, I added a line "if condition" in order to better suit my need but not sure to write it correctly because it doesn't work out as expected when I'm running it.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (state == 6 || state == 7) { // Resolved or Closed
target.close_code = 'Solved (Permently)';
target.close_notes = 'Closed from import set';
}
})(source, map, log, target);
Any ideas where I could make a mistake ?