- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
required help @Vasantharajan N @Ankur Bawiskar @Voona Rohila @WillieW @RaghavSh
When Feature field change on the story and new Feature selected in the available list and then the Impact of the story is to be fill based on the new selected Feature.
Story Impact should be based on Feature field.
I tried with Business Rule but it's not working as expected.
Business Rule:
var fst = new GlideRecord('sn_safe_feature');
fst.addQuery('sn_safe_story',current.sys_id);
fst.query();
while(fst.next()){
fst.impact = current.impact;
fst.priority = current.priority;
fst.update();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
your business rule should be before Insert & Update
Condition: Feature [Changes] AND Feature [IS NOT EMPTY]
Script:
// use correct field which refers to feature table below
current.impact = current.sn_safe_feature.impact;
current.priority = current.sn_safe_feature.priority;
💡 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
8 hours ago
Hi @Arjun Reddy Yer ,
Your logic is reversed. You are updating Feature from Story, but the requirement is to update Story Impact based on selected Feature.
When Feature field changes on Story, copy values from Feature → to Story.
Business Rule setup
Table: Story (sn_safe_story)
When: before
Insert: true
Update: true
Condition: Feature changes
if (!current.feature)
return;
var featureGR = new GlideRecord('sn_safe_feature');
if (featureGR.get(current.feature)) {
// Copy from Feature to Story
current.impact = featureGR.impact;
current.priority = featureGR.priority;
}
or you can write the on change client script . when the feature field value changes it will populate the other field values . let me know if you need on change client script and script include logic ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
your business rule should be before Insert & Update
Condition: Feature [Changes] AND Feature [IS NOT EMPTY]
Script:
// use correct field which refers to feature table below
current.impact = current.sn_safe_feature.impact;
current.priority = current.sn_safe_feature.priority;
💡 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
7 hours ago - last edited 7 hours ago
Tried with below script but on the form when I try to change Safe Team is getting empty so unable to change.
But I try it in List view to change the Feature field value but the Impact of the Story is not getting change.
var featureGR = new GlideRecord('sn_safe_feature');
if (featureGR.get(current.feature)) {
// Copy from Feature to Story
current.impact = current.sn_safe_feature.impact;
current.priority = current.sn_safe_feature.priority;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
why are you again querying the feature table?
you already have a reference field pointing to that?
simply dot walk and set the values similar to what I shared
💡 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