- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 12:14 PM
how can i achieve it through flow designer.
When a child record state has been changed, update the work notes of the parent record Stating “the state of the child has been changed to new state value of child incident.
Any help will be Appreciated.
Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 07:50 PM
you can use after update BR or flow designer for this
what did you start with?
Something like this in after update BR on incident
Condition: State Changes && Parent is not empty
Script:
(function executeRule(current, previous /*null when async*/ ) {
var parent = new GlideRecord('incident'); // Change 'incident' to the parent table name
parent.addQuery('sys_id', current.parent).addOrCondition('sys_id', current.parent_incident);
parent.query();
if (parent.next()) {
// Update the work notes of the parent record
parent.work_notes = 'The state of the child has been changed to ' + current.state.getDisplayValue();
parent.update();
}
})(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
12-29-2024 12:53 PM
Hi @purnendu
I am not sure what your use case is because if a parent record has five children and every child gets updated, then it adds it to the parent. As soon as it is added to the parent, it is considered work notes, and an email will trigger the group. What is your exact use case?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 02:08 PM
Hi @purnendu
please notice that best practice is to work on a parent ticket where comments will be copied to child, not the other way around.
What is the business case for the need you’re asking?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 07:50 PM
you can use after update BR or flow designer for this
what did you start with?
Something like this in after update BR on incident
Condition: State Changes && Parent is not empty
Script:
(function executeRule(current, previous /*null when async*/ ) {
var parent = new GlideRecord('incident'); // Change 'incident' to the parent table name
parent.addQuery('sys_id', current.parent).addOrCondition('sys_id', current.parent_incident);
parent.query();
if (parent.next()) {
// Update the work notes of the parent record
parent.work_notes = 'The state of the child has been changed to ' + current.state.getDisplayValue();
parent.update();
}
})(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