diff --git a/module/bug/js/common.js b/module/bug/js/common.js
index aed56f6705..0f2a7fcde3 100644
--- a/module/bug/js/common.js
+++ b/module/bug/js/common.js
@@ -202,3 +202,23 @@ function loadProjectBuilds(projectID)
$('#resolvedBuildBox').load(link);
}
}
+
+/**
+ * Set story field.
+ *
+ * @param moduleID $moduleID
+ * @param productID $productID
+ * @access public
+ * @return void
+ */
+function setStories(moduleID, productID)
+{
+ link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&moduleID=' + moduleID);
+ $.get(link, function(stories)
+ {
+ if(!stories) stories = '';
+ $('#story').replaceWith(stories);
+ $('#story_chzn').remove();
+ $("#story").chosen({no_results_text: ''});
+ });
+}
diff --git a/module/bug/js/create.js b/module/bug/js/create.js
index 6760e8b068..30b31a9762 100644
--- a/module/bug/js/create.js
+++ b/module/bug/js/create.js
@@ -40,26 +40,6 @@ function setAssignedTo(moduleID, productID)
});
}
-/**
- * Set story field.
- *
- * @param moduleID $moduleID
- * @param productID $productID
- * @access public
- * @return void
- */
-function setStories(moduleID, productID)
-{
- link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&moduleID=' + moduleID);
- $.get(link, function(stories)
- {
- if(!stories) stories = '';
- $('#story').replaceWith(stories);
- $('#story_chzn').remove();
- $("#story").chosen({no_results_text: ''});
- });
-}
-
/* Save template. */
KindEditor.plugin('savetemplate', function(K)
{
diff --git a/module/bug/js/edit.js b/module/bug/js/edit.js
index a8a2dc177c..994831ae60 100644
--- a/module/bug/js/edit.js
+++ b/module/bug/js/edit.js
@@ -41,3 +41,16 @@ function getList(module)
$('#taskListIdBox a').attr("href", link);
}
}
+
+/**
+ * load stories of module.
+ *
+ * @access public
+ * @return void
+ */
+function loadModuleRelated()
+{
+ moduleID = $('#module').val();
+ productID = $('#product').val();
+ setStories(moduleID, productID);
+}