diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js
index c20ad5c..521e671 100644
--- a/erpnext/support/doctype/issue/issue.js
+++ b/erpnext/support/doctype/issue/issue.js
@@ -1,7 +1,7 @@
 frappe.ui.form.on("Issue", {
 	onload: function(frm) {
 		frm.email_field = "raised_by";
-		frm.set_query('customer', function () {
+		frm.set_query("customer", function () {
 			return {
 				filters: {
 					"disabled": 0
@@ -28,14 +28,14 @@
 				},
 				callback: function (r) {
 					if (r && r.message) {
-						frm.set_query('priority', function() {
+						frm.set_query("priority", function() {
 							return {
 								filters: {
 									"name": ["in", r.message.priority],
 								}
 							};
 						});
-						frm.set_query('service_level_agreement', function() {
+						frm.set_query("service_level_agreement", function() {
 							return {
 								filters: {
 									"name": ["in", r.message.service_level_agreements],
@@ -52,9 +52,9 @@
 		if (frm.doc.status !== "Closed" && frm.doc.agreement_status === "Ongoing") {
 			if (frm.doc.service_level_agreement) {
 				frappe.call({
-					'method': 'frappe.client.get',
+					"method": "frappe.client.get",
 					args: {
-						doctype: 'Service Level Agreement',
+						doctype: "Service Level Agreement",
 						name: frm.doc.service_level_agreement
 					},
 					callback: function(data) {
@@ -134,8 +134,8 @@
 				reset_sla.clear();
 
 				frappe.show_alert({
-					indicator: 'green',
-					message: __('Resetting Service Level Agreement.')
+					indicator: "green",
+					message: __("Resetting Service Level Agreement.")
 				});
 
 				frm.call("reset_service_level_agreement", {
@@ -155,33 +155,33 @@
 
 	timeline_refresh: function(frm) {
 		// create button for "Help Article"
-		if(frappe.model.can_create('Help Article')) {
+		if(frappe.model.can_create("Help Article")) {
 			// Removing Help Article button if exists to avoid multiple occurance
 			frm.timeline.wrapper.find('.comment-header .asset-details .btn-add-to-kb').remove();
 			$('<button class="btn btn-xs btn-link btn-add-to-kb text-muted hidden-xs pull-right">'+
 				__('Help Article') + '</button>')
 				.appendTo(frm.timeline.wrapper.find('.comment-header .asset-details:not([data-communication-type="Comment"])'))
-				.on('click', function() {
-					var content = $(this).parents('.timeline-item:first').find('.timeline-item-content').html();
-					var doc = frappe.model.get_new_doc('Help Article');
+				.on("click", function() {
+					var content = $(this).parents(".timeline-item:first").find(".timeline-item-content").html();
+					var doc = frappe.model.get_new_doc("Help Article");
 					doc.title = frm.doc.subject;
 					doc.content = content;
-					frappe.set_route('Form', 'Help Article', doc.name);
+					frappe.set_route("Form", "Help Article", doc.name);
 				});
 		}
 
-		if (!frm.timeline.wrapper.find('.btn-split-issue').length) {
+		if (!frm.timeline.wrapper.find(".btn-split-issue").length) {
 			let split_issue = __("Split Issue")
 			$(`<button class="btn btn-xs btn-link btn-add-to-kb text-muted hidden-xs btn-split-issue pull-right" style="display:inline-block; margin-right: 15px">
 				${split_issue}
 			</button>`)
 				.appendTo(frm.timeline.wrapper.find('.comment-header .asset-details:not([data-communication-type="Comment"])'))
 			if (!frm.timeline.wrapper.data("split-issue-event-attached")){
-				frm.timeline.wrapper.on('click', '.btn-split-issue', (e) => {
+				frm.timeline.wrapper.on("click", ".btn-split-issue", (e) => {
 					var dialog = new frappe.ui.Dialog({
 						title: __("Split Issue"),
 						fields: [
-							{fieldname: 'subject', fieldtype: 'Data', reqd:1, label: __('Subject'), description: __('All communications including and above this shall be moved into the new Issue')}
+							{fieldname: "subject", fieldtype: "Data", reqd:1, label: __("Subject"), description: __("All communications including and above this shall be moved into the new Issue")}
 						],
 						primary_action_label: __("Split"),
 						primary_action: function() {
@@ -234,7 +234,7 @@
 function get_time_left(timestamp, agreement_status) {
 	const diff = moment(timestamp).diff(moment());
 	const diff_display = diff >= 44500 ? moment.duration(diff).humanize() : "Failed";
-	let indicator = (diff_display == 'Failed' && agreement_status != "Fulfilled") ? "red" : "green";
+	let indicator = (diff_display == "Failed" && agreement_status != "Fulfilled") ? "red" : "green";
 	return {"diff_display": diff_display, "indicator": indicator};
 }
 
