In ServiceNow, there is often a need to synchronize Work Notes and Additional Comments across related task records. This is typically accomplished using a few business rules and logic to prevent looping. In the Customer Service Management (CSM) environment, Additional Comments on case records are primarily used to update the customer. When a case has related records such as case tasks, incidents, etc., how can we better enable agents to communicate seamlessly with the customer from their active task record?
The solution we will discuss in this article might not be the optimal one and is somewhat of an unconventional approach I devised while experimenting with the configurability of configurable workspaces using UI Builder.
Scenario
Consider we have Case [sn_customerservice_case] records and Case Task [sn_customerservice_task] records. Agents working on a Case Task should be able to add comments directly to the Case without needing to open the Case record. Screenshots below depict how the OOB (out-of-box) forms look like for a Case and Case Task.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/oob_case_form_layout-1024x459.png)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/oob_case_task_form_layout-1024x396.png)
Target view for Agents
With a layout like below, agents working on a Case Task will be able to add comments directly to the Case without needing to open the Case record.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/multiple_journal_ui_builder-1024x448.png)
Configuration steps
Follow the steps listed below to add the journal input section of the parent Case record into the Case Task form.
Modify the record page for Case Tasks
- Set the application scope to ‘CSM Configurable Workspace’.
- Navigate to UI builder.
- From the ‘Experiences’ list, look for and open the ‘CSM/FSM Configurable Workspace’ record. https://instance.service-now.com/now/builder/ui/experience/c4e321a3530210102c30ddeeff7b12f6
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/csm_workspace_experience_record-1024x508.png)
- Under the ‘Pages and variants’ list, look for and open the ‘CSM default record page’ record. Notice that the page is read-only.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/csm_default_record_page_ui_builder-1024x167.png)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/csm_default_record_page_open-1024x427.png)
- Use the hamburger menu present at the top left corner to create a duplicate of this OOB page.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/csm_default_record_duplicate-1024x318.png)
- Give the page variant a desired name, condition needs to be set as ‘table=sn_customerservice_task’ as we want it to be visible for Case Tasks only.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/csm_default_create_variant_page-1024x883.png)
- The new variant will be ready in a few seconds and open up on your screen. Notice that the page is now editable.
- The body section of the page would initially be blank, we can fill it up by applying test values from the top left.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/case_task_record_test_values-806x1024.png)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/case_task_record_page_full-1024x408.png)
- Using the search bar on the top left, search for the component ‘Activity Stream Compose’ and select it.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/search_activity_stream_compose.png)
- Navigate to the ‘Config’ tab on the right panel.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/config_panel_activity_compose.png)
- Under the ‘Data’ section, we need to modify the values to dynamically pick the Parent Case record from the Case Task.
- Use data binding to set the value of ‘Table’ to ‘@data.record.form.fields.parent_case.reference’.
- Use data binding to set the value of ‘Sys ID’ to ‘@data.record.form.fields.parent_case.referenceSysId’.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/config_table_sysid.png)
- For ‘Fields definition’, use static input and edit in the popup to remove the ‘work_notes’ object and keep only the ‘comments’ object.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/fields_def_only_comments.png)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/only_comments_object-1024x706.png)
- Under the ‘Display’ section use data binding to set the value ‘Title’ to dynamically pick the Parent Case number. The value needs to be set to ‘@data.record.form.fields.parent_case.displayValue’.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/compose_title.png)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/compose_title_modify.png)
- We should also configure the ‘Component visibility’ section to hide the component if our Case Task does not have a Parent Case.
- Use data binding to set the value of ‘Hide component’. The value would already be set as a combination of conditions, we need to append ‘|| !@data.record.form.fields.parent_case.referenceSysId’ towards the end.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/hide_condition_referencesysid.png)
- Save the configurations using the ‘Save’ button at the top right.
- We have successfully added the ‘Comments’ section from the Parent Case onto the Case Task record.
- Next, we need to revive the ‘Work notes’ section for the Case Task.
- Using the search bar on the top left, search for ‘sbs-right-bottom’ and select the component ‘Activity Stream’ present under it.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/sbs_right_bottom_search.png)
- Using the three dots beside the component, click on ‘Add before’ and select the ‘Activity Stream Compose’ component from the popup.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/add_before_option.png)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/component_selector_popup-1024x413.png)
- Once the new component is added, select it and navigate to the ‘Config’ tab on the right panel.
- Under the ‘Data’ section, for ‘Fields definition’, use static input and edit in the popup to remove the ‘comments’ object and keep only the ‘work_notes’ object. (similar to step 14, just reversed)
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/only_work_notes_object.png)
- Save the configurations using the ‘Save’ button at the top right.
- If test values were filled in Step 8, then the UI builder screen would look something like below.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/comple_config_ui_builder_page-1024x388.png)
- Clean the cache with ‘cache.do’.
Verify the configuration
If all the 27 steps have been followed accurately, then the Case Task records that are linked to a Parent Case will render two separate journal inputs like below.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/complete_config_workspace_record-1024x410.png)
Any comments posted via the section on top will directly add comments on the Parent Case. If the Case Task is not linked to a Parent Case, the page would render without the comments section like below.
![](https://sasachblog.b-cdn.net/wp-content/uploads/2024/07/comple_config_workspace_record_no_parent-1024x349.png)
If the functionality is not working as expected, backtrack on the mentioned steps and verify whether all of them were executed correctly, else we can always start from the scratch.
Next steps
These steps can be replicated for all kind of related records and journal fields by just changing the table and field names, as long as the linked record is available on the form view of UI builder – this is mandatory since we utilise the data binding as @data.record.form.fields… in the configurations.