Blog

Epics without Stories

Here is a quick script to find Epics without Stories

1. Elevate your privilege to security_admin.
2. In the Left Navigator > Scripts - Background
3. Paste this in the Run Scripts area:

//Find Epics without Stories
(function() {
  var epicList = [];
  var grEpic = new GlideRecord("rm_epic");
  grEpic.query();
  while (grEpic.next()) {
    var gaStory = new GlideAggregate("rm_story");
    gaStory.addQuery("epic",grEpic.sys_id);
    gaStory.addAggregate('COUNT');
    gaStory.query();
    if (gaStory.next()) {
       if (gaStory.getAggregate('COUNT') == 0) {
         epicList.push(grEpic.getValue("number"));
       }
    }
  }
  gs.print(epicList.toString());
})();

4. Click Run Script