- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
You must update an Incident, create 3 related RITMs, and upsert 150 CI relations atomically. If any step fails, everything must roll back. How would you implement this in scoped apps using GlideRecord, background scripts, or GlideTransaction patterns—without relying on Flow Designer? Discuss pitfalls around BR recursion and after-commit work.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago - last edited 4 weeks ago
Solution approach
-
Use a Script Include to handle everything in one try/catch.
-
Keep arrays of created sys_ids (RITMs, CI relations).
-
If any step fails:
-
Revert Incident to old values.
-
Delete inserted RITMs.
-
Delete inserted CI relations.
-
-
Guard recursion with a session flag (gs.getSession().putProperty()).
-
Suppress after-commit notifications during this batch (add conditional checks in BRs).
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
ď”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ď”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
gs.getSession().putProperty() is a server-side method in ServiceNow used to store a custom property within the current user's GlideSession. This property can then be retrieved later in the same session using gs.getSession().getProperty().
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
ď”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ď”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Sorry what's your actual business requirement?
Your above question seems just like a statement or some kind of interview 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
4 weeks ago
Yes kind of interview question.. can you help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
So what was your response or what do you think can be done here?
If community members suggest you then you won't learn from your side on the possible ways to achieve.
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
4 weeks ago
With due respect, the question shared was indeed an interview-style scenario that many of us face while preparing or working on advanced implementations. The purpose of the community is not only to solve immediate production problems but also to discuss patterns, approaches, and pitfalls that can help learners and practitioners grow.
When someone posts such a scenario, it’s usually after trying on their own and wanting to validate their thought process or get insights from others with deeper experience. If the community members discourage such questions, it may demotivate people who are genuinely trying to learn and improve.
Also, please don’t act like a boss here—ServiceNow is no one’s personal property. This community belongs to everyone, and people come here to learn, share, and grow together.
If you feel the question is not relevant for you, it’s perfectly fine not to respond. But many others—including students, freshers, and working professionals—can benefit from constructive guidance on such queries.
So let’s continue to maintain a spirit of collaboration here—where even “interview-style” questions are valid learning opportunities.