- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 10:42 PM
Hi Experts,
I am trying to copy the OOB incident number value from instance 1 to a custom field called u_incident_number on instance 2.
I have written below source script but when checked found that it is returning undefined value as you can see in below screenshot.
Can anyone please tell me what is wrong with this script.
Please consider below screenshot for your reference.
Thank you.
Rishi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 11:22 PM
Hi Rishi,
In the source script you are not supposed to use the target object. modify your code as below and test again.
var x = source.number; // ensure number is the correct column from import set table since the import set table is a custom table and fields should start with "u_"
gs.log('Number is: ' + x);
return x;
Also since you are not modifying any value from the incoming number field before mapping why to use source script and not directly have 1 to 1 mapping?
Any specific reason to have source script here
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎01-29-2018 11:47 PM
Hi Ankur,
I will try above and get back to you.
Also I have already tried using 1 to 1 mapping but it is not working.
Please refer below thread for more details:
Servicenow to Servicenow interation
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 03:04 AM
Hi Rishi,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
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
‎02-05-2018 03:15 AM
Hi Rishi,
Did you get this resolved?
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
‎02-08-2018 04:55 AM
Hi Ankur,
My issue has been resolved now.
Thank you for your help !!
Regards,
RIshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2018 06:08 AM
Hi Rishi,
That's great. Could you also mark my answer as correct. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader