- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi, I just wanna say that I am very new to Snow and I'm just getting to know the platform.
I got assigned the following task:
I would like the category and subcategory of incident to carry over to change records when a change is created from an incident record.
In the incident form, I have the change request related list in which I can submit a new change by clicking the New button. This button redirects me to sn_chg_model_ui_landing.do, not to the change_request.do page. How do I manage to carry over the cat and subcat from my incident? I know I can do it via params in the URL:
But it doesn't work when I select the model from the sn_chg_model_ui_landing.do. Any help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ernestogome
you can try with before Business rule to map the category and subcategory from incident to change but make sure the value of the category and subcategory of incident and also change is same.
if yes then try this way
Table: Change Request (change_request)
When: before
Insert: Checked
Condition: parent is not empty.
Script:
(function executeRule(current, previous /*null when async*/) {
var parentRec = current.parent.getRefRecord();
if (parentRec.isValidRecord() && parentRec.getTableName() == 'incident') {
// Copy the values
current.category = parentRec.category;
current.subcategory = parentRec.subcategory;
}
})(current, previous);
If this information proves useful, kindly mark it as helpful or accepted solution.
Thanks,
BK
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
see when you click New button in related and when new CHG form is opened if INC sysId is there in URL
if yes then extract that and then query it in display business rule on change_request and use that to get category subcategory and set it on CHG
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello @ernestogome ,
Since you got the SysId, you can do a GlideAjax() call to the Server side and get the details.
Regards,
Najmuddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi @ernestogome,
Try to use the business rule for the change in category and subcategory; using the below actions will help you for the solution.
Table: Change Request (change_request)
When: before
Insert: Checked
Condition: parent is not empty.
If you find my answer useful, please mark it as Helpful and Correct 😊
Regards,
Soham Tipnis
ServiceNow Developer || Technical Consultant
LinkedIn: www.linkedin.com/in/sohamtipnis10
