- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 06:05 AM
I want to change the state of rm_story table to ready whenever 'test result' changes to fail of rm_scrum_task table via business rule. i have made following changes but not working.
Suggest me better approach
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 07:44 AM
You can follow steps given in below video link to understand how to update parent record which is story record from child scrum task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 08:28 AM
Hi @Balakrishna_ABK ,
Hope you are doing great.
- create a new business rule on "rm_scrum_task" table .
- Specify the conditions for the business rule to trigger. In this case, the condition should be: current.test_result.changesTo('fail').
- Add the script to perform the state change for the related "rm_story" record. You can use the GlideRecord API to update the "rm_story" table.
(function executeRule(current, previous) {
var storyGR = new GlideRecord('rm_story');
storyGR.addQuery('sys_id', current.rm_story); // Assuming a reference field "rm_story" links the two tables
storyGR.query();
if (storyGR.next()) {
storyGR.state = 'ready';
storyGR.update();
}
})(current, previous);
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 06:15 AM
Create a After business rule instead of before and add below script in Business rule (Modify and add correct backend value of ready state)
var story = new GlideRecord('rm_story');
if (story.get(current.rm_story)) {
story.state = 'ready'; //add backend value of ready state
story.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 07:39 AM
Hi Manmohan thanks for your reply, how can we achieve same from flow designer ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 07:44 AM
You can follow steps given in below video link to understand how to update parent record which is story record from child scrum task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 08:28 AM
Hi @Balakrishna_ABK ,
Hope you are doing great.
- create a new business rule on "rm_scrum_task" table .
- Specify the conditions for the business rule to trigger. In this case, the condition should be: current.test_result.changesTo('fail').
- Add the script to perform the state change for the related "rm_story" record. You can use the GlideRecord API to update the "rm_story" table.
(function executeRule(current, previous) {
var storyGR = new GlideRecord('rm_story');
storyGR.addQuery('sys_id', current.rm_story); // Assuming a reference field "rm_story" links the two tables
storyGR.query();
if (storyGR.next()) {
storyGR.state = 'ready';
storyGR.update();
}
})(current, previous);
Regards,
Riya Verma