- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 04:35 AM
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).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 01:20 AM - edited 01-10-2024 04:21 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 04:55 AM
have multiple threads on the same topic, hard to follow and no response back.
You asked the same thing here Issue with work_notes visibility. - ServiceNow Community Based on user, now its the roles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 04:56 AM
I started a new thread to make it more clear. Sorry, was not able to delete the old thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 01:20 AM - edited 01-10-2024 04:21 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 07:21 AM
I'm a little curious about what you did in step 2, can you elaborate on couple of widget, and couple of places. We have this exact issue.