- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 12:35 AM
Hi Team,
We are having requirement that we are having one field called add info (reference user field) so when there is an additional comment from this user we need to change the state to WIP.
currently i'm getting a latest comment in this format:
2022-04-27 09:21:27 - user1 (Additional comments)
tested ok
so here we need only user1 value to compare with add info field which we have created.
Please help with the code.
Thanks,
Sri
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 02:56 AM
Hi,
update as this
var addinfousr = current.u_additional_information.getDisplayValue();
gs.log("additional user information:::"+addinfousr);
var com = current.comments.getJournalEntry(1);
if(com.indexOf(addinfousr) > -1)
{
gs.log("inside the latest update from add info if statement:::");
current.state='2';
current.update();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 02:56 AM
Hi,
update as this
var addinfousr = current.u_additional_information.getDisplayValue();
gs.log("additional user information:::"+addinfousr);
var com = current.comments.getJournalEntry(1);
if(com.indexOf(addinfousr) > -1)
{
gs.log("inside the latest update from add info if statement:::");
current.state='2';
current.update();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader