When defect is created under parent story, Planned effort of that new defect must get added to story
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 11:04 PM - edited 04-16-2025 11:07 PM
When defect is created under parent story, "Planned effort" of that new defect must get added to story "Planned effort", currently Out of the box functionally replaces the "Planned effort" of story with "Planned effort" of defect. I want to get it added instead.
earlier story story had "Planned effort" 2, but when defect got created "Planned effort" of story got replaced with "Planned effort" of defect.
Child defect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 11:18 PM
Hi @indrasengupta ,
Try Business rule
Table: rm_defect
When: after insert
Condition: parent is not empty
(function executeRule(current, previous /*null when async*/) {
if (!current.parent || !current.planned_effort)
return;
var parent = new GlideRecord('rm_story');
if (parent.get(current.parent)) {
// Add defect's effort to story's effort
var defectEffort = parseFloat(current.planned_effort.toString()); // in seconds
var storyEffort = parseFloat(parent.planned_effort.toString()); // in seconds
var newEffort = storyEffort + defectEffort;
parent.planned_effort = newEffort;
parent.update();
}
})(current, previous);
If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2025 11:47 AM
Did not worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 11:40 PM - edited 04-16-2025 11:42 PM
Hello @indrasengupta ,
How is defect created? If this is created through an UI action, check for the script in UI Action that updates planned efforts. E.g. below :
current.planned_effort = defect.planned_effort
change to -----> current.planned_effort += defect.planned_effort
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 05:36 AM
I am creating defect from story related list