- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 12:34 AM
Hi,
Onboarding tasks- comments on task level roll up to parent.
As an HR Agent, if an employee or manager submits a comment on an Onboarding task, I can see all of the comments on the HR Case.
When employee or manager submits comment on Onboarding task then I should see all comments on HR case.
Can anyone please help me to achieve it.
Regards,
Nivedita
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 08:26 AM
@niveditakumari Deactivate your business rule in HR Core scope and create a copy of the same Business rule in Human Resources Lifecycle Events scope along with the same script. Ideally, this will address your scope error issue as the worknotes would be added into the LE scope only.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 08:26 AM
@niveditakumari Deactivate your business rule in HR Core scope and create a copy of the same Business rule in Human Resources Lifecycle Events scope along with the same script. Ideally, this will address your scope error issue as the worknotes would be added into the LE scope only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 11:48 AM
Hi @Sandeep Rajput,
It worked.
Thank you so much for all your help and make me understand for this concept.
Regards,
Nivedita

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 08:10 PM
Glad to know that it worked for you 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 08:32 AM
Hi @niveditakumari ,
I trust you are doing great.
we will need to create a new field in the Onboarding Task table to store comments. We will also need to create a business rule that triggers when a comment is added to an Onboarding Task and copies the comment to the newly created field.
Here are the steps to implement this functionality:
Create a new field in the Onboarding Task table to store comments. We can name this field "Comments Rollup" (or any other name you prefer) and set the field type to "Text".
Create a business rule that triggers when a comment is added to an Onboarding Task. The business rule should copy the comment to the "Comments Rollup" field of the corresponding HR Case.
Please fine the code for the same
/* Business Rule: Onboarding Task Comments Rollup */
/* When a comment is added to an Onboarding Task, roll up the comment to the corresponding HR Case */
(function executeRule(current, previous /*null when async*/) {
// Get the HR Case associated with the Onboarding Task
var hrCase = new GlideRecord('sn_hr_core_case');
hrCase.get(current.request);
// Get the existing comments from the HR Case
var comments = hrCase.comments.getJournalEntry(-1);
// Add the new comment to the existing comments
comments += "\n" + current.comments.getJournalEntry(-1);
// Update the HR Case with the new comments
hrCase.comments = comments;
hrCase.update();
})(current, previous);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2023 03:23 AM
Hi @Amit Gujarathi,
I have to achieve it with available additional comments field. I don't want to create new field.
Regards,
Nivedita