
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 08:04 AM
Hello, i've been creating some Notifications for actions like "New additional comments by (opened_by)" and i was trying to do something like this to check if the commenting user is the one that opened the request
var currentUser = gs.getUserID();
var openedBy = current.opened_by;
Then, i wanted to check if new comments have been added with :
var newComments = previous.additional_comments != current.additional_comments ? true : false;
and finally, deciding if the notification will be triggered with :
if ((currentUser == openedBy) && newComments){
answer = true;
}
I know additional_comments is a Journal field, but since i only wanted to check for differences (i dont care about the content) i thought i could simply use current and previous, but it doesn't seem to work.
How could i write a condition that checks if there are new comments, and if they were written by a certain user?
Could i combine the Conditions builder with the Advanced condition script? that way i would only need to write a script that checks the user, and let the simple Condition check for additional comments changes.
Thank you kindly!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:25 AM
Hi Alcaine,
Try as current.comments.changes() //This will return true if new comments are added to the form or not.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 09:25 AM
Hi Alcaine,
Try as current.comments.changes() //This will return true if new comments are added to the form or not.