- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 03:13 PM
Hello, how can I assign the same category, subcategory and Configuration item from the Task catalog to a change request (parent) generated from a task (related list)?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 09:44 PM
you can use before insert BR on change_request table
Condition: current.parent != ''
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.category = current.parent.category;
current.cmdb_ci = current.parent.cmdb_ci;
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-03-2025 11:33 PM
Hi @williams2 ,
You can write before insert BR on change request table and use below script.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.category = current.parent.category;
current.sub_category = current.parent.sub_category;
current.cmdb_ci = current.parent.cmdb_ci;
})(current, previous);
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 09:44 PM
you can use before insert BR on change_request table
Condition: current.parent != ''
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.category = current.parent.category;
current.cmdb_ci = current.parent.cmdb_ci;
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-05-2025 05:26 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-06-2025 09:41 AM
It worked fine, thank you very much for your help
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 11:33 PM
Hi @williams2 ,
You can write before insert BR on change request table and use below script.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.category = current.parent.category;
current.sub_category = current.parent.sub_category;
current.cmdb_ci = current.parent.cmdb_ci;
})(current, previous);
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------