- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2016 07:58 AM
Hi All,
I am trying to write a simple condition to check if request.requested for and opened are different (not the same user) in order to prevent issuing some email notifications when the requestor updates a ticket him/herself.
Condition that didn't work:
1. answer = (current.request.requested_for.user_name.getDisplayValue() != current.updated_by);
2. answer = (current.request.requested_for.user_name != current.updated_by);
3. answer = (current.request.requested_for != current.updated_by);
4. answer = (request.requested_for != current.updated_by);
What am I missing? Does anyone have ideas on how to do this?
Kind regards,
Kamile
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2016 09:11 AM
Hey Kamile,
This should work
answer = (current.request.requested_for.user_name != current.sys_updated_by);
Correction : updated_by is not the right column name and it should be sys_updated_by.
I hope this answers your question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2016 08:09 AM
Line 3 and 4 wont work because left hand side result is a 32 bit sys_id and right hand side result is a string.
In case 1 and 2, mostly it looks like it will work, but have a concern about when the updated_by field will be updated?
I presume its a business rule on the table
you can write the condition as -
current.request.requested_for != gs.getUserID(); //considering most of the updates happens through interactive session
Now any triggers happens on the record, it will compare the logged in user and compare with requested for
For debug purpose, could you please print these values before the comparision-
gs.log('Requested for: ' + current.request.requested_for, 'debugNotif');
gs.log('User Logged: ' + gs.getUserID(), 'debugNotif');
answer = (current.request.requested_for != gs.getUserID());
Hopefully it should help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2016 09:11 AM
Hey Kamile,
This should work
answer = (current.request.requested_for.user_name != current.sys_updated_by);
Correction : updated_by is not the right column name and it should be sys_updated_by.
I hope this answers your question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2016 03:19 AM
This one worked perfectly. And thank you for the correction that I should of used sys_updated_by not just updated_by