Hiding work notes from Employee Center Portal

vidhya_mouli
Tera Sage

Is there a way to hide work notes from Employee Portal. Right now work notes is not visible for non itil users and is visible for ITIL users. This is for incident management (using Standard ticketing widget).

1 ACCEPTED SOLUTION

vidhya_mouli
Tera Sage

Finally managed to do it. To remove work notes form employee center for everyone, I had to do the following:

Step 1. Clone Standard Ticket Conversation Widget (standard_ticket_conversations_sv) and added few lines of code in the client script.

 

 

 

 

function mergeStreamEntries() {
		$scope.placeholder = $scope.data.placeholderNoEntries;
		if (!$scope.data.stream || !$scope.data.stream.entries)
			return;
		$scope.placeholder = $scope.data.placeholder;
		
		//****************** NEW CODE ADDED ********************************//
		var newEntries = [];
        $scope.data.stream.entries.forEach(function(entry) {
    	if (entry.element != "work_notes") {
    		newEntries.push(entry);
    	}
    });
		
		$scope.data.stream.entries = newEntries;
		//****************** NEW CODE ADDED ********************************//


	
		$scope.data.rich_text_editor = (c.options.rich_text_editor == 'true');
		$scope.data.at_mentions = (c.options.at_mentions == 'true');
		unblockTheComments();
		var entries = $scope.data.stream.entries;
		if (!$scope.data.mergedEntries) {
			$scope.data.mergedEntries = $scope.data.stream.entries.slice();
			for (var i = 0; i < entries.length; i++) {
				if (entries[i].value)
					entries[i].value = entries[i].value.replace(/\n/g, '<br/>');
				existingEntries[entries[i].sys_id] = true;
			}

			return;
		}

		var mergedEntries = $scope.data.mergedEntries;
		for (var i = entries.length-1; i >= 0; i--) {
			var curEntry = entries[i];
			if (isNewEntry(mergedEntries, curEntry)){
				if (curEntry.value)
					curEntry.value = curEntry.value.replace(/\n/g, '<br/>');
				mergedEntries.unshift(curEntry);
				existingEntries[curEntry.sys_id] = true;
			}
		}
	}

 

 

 


Step 2. Clone Standard Ticket Tab and replaced couple of widget.

Changed std_ticket_conversations to standard_ticket_conversations_sv in couple of places.

 

Finally Step 3: Replaced the Standard Ticket Tab with the cloned widget in Page Editor.

 

View solution in original post

5 REPLIES 5

Kajal3
Tera Contributor

Can you please help elaborate on step 2 and 3. I have done the step 1 as mentioned but not getting what exactly the changes need to do for step 2 and 3. We have this exact requirement.