I want to grab the user's name that makes an entry on a RITM when that person is not on the RITM or TASK, but can make a comment.

Marshall Day
Mega Expert

If someone makes a customer visible comment on a RITM or Task their comment is captured in the Activity log along with their user name. I am trying to capture that user's name and apply it to the notification that is sent out to the Assigned to and/or Customer. I can't seem to find a field in either the sc_req_item or the task tables that grabs that info for me. Any pointers would be appreciated.

Thanks

1 ACCEPTED SOLUTION

All,


It took some figuring but Sanjiv was on the right path he just didn't go far enough.



It turns out that selecting the correct event to fire the notification gets you half way to the end game. In the Business rule that that event uses is where the real magic occurs. By specifically listing the requirement in the event.parm1 you are able to do exactly as I was asking for in the question: grab the current logged in user's name and include it in the notification so that the receivers will know who made that comment. Many times there are users/managers that make entries into records that are not assigned to them.



I have included the Business Rule script that was completed so that others may use it if they so desire. Ours is set up for SCTask but can be easily modified to suit.



gs.info("comments ===========>>"+current.comments);//


      var grSCTask = new GlideRecord("sc_task");


      grSCTask.addQuery("request_item", current.sys_id);


      grSCTask.query();


      while(grSCTask.next()){


              gs.eventQueue("su.ritm.commented", current, gs.getUser().getFullName(), grSCTask.assigned_to);              


      }



In the notification just call for ${event.parm1} to grab the user's full name and place it in the email to allow the recipients to know who made a comment on their request.



I hope this helps those out there that may have been asking the same question.



Marshall


View solution in original post

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

How do user add comments to the comment? Is it not the requestor?


If not, you can add such users to watchlist using a business rule to your RITM.



Please mark this response as correct or helpful if it assisted you with your question.

Sanjiv,


Thanks fro responding. Maybe I wasn't clear enough in my question. Let me be more eloquent.



A user, with ITIL role, can access any RITM (unless secured). If this user opens a RITM or TASK and makes a Customer Visible comment, for whatever reason, the comment is captured in the Activity log, along with the name of the person making the comment (obviously they are logged in). At this point an email is fired to the Assigned to and the Customer notifying them of the comment being added to the record.



I want to grab the user's name (the one that just made the entry) and put it into the notification. This will identify to the pertinent parties who was the one making the entry. The Requested by may not be able to see the record to know who specifically made the comment.



This way all concerned users (Assigned to, Requested by, the Watch list) will see in their notification the specific user's name that made the comment.



I hope this clears up my question.



Marshall


All,


It took some figuring but Sanjiv was on the right path he just didn't go far enough.



It turns out that selecting the correct event to fire the notification gets you half way to the end game. In the Business rule that that event uses is where the real magic occurs. By specifically listing the requirement in the event.parm1 you are able to do exactly as I was asking for in the question: grab the current logged in user's name and include it in the notification so that the receivers will know who made that comment. Many times there are users/managers that make entries into records that are not assigned to them.



I have included the Business Rule script that was completed so that others may use it if they so desire. Ours is set up for SCTask but can be easily modified to suit.



gs.info("comments ===========>>"+current.comments);//


      var grSCTask = new GlideRecord("sc_task");


      grSCTask.addQuery("request_item", current.sys_id);


      grSCTask.query();


      while(grSCTask.next()){


              gs.eventQueue("su.ritm.commented", current, gs.getUser().getFullName(), grSCTask.assigned_to);              


      }



In the notification just call for ${event.parm1} to grab the user's full name and place it in the email to allow the recipients to know who made a comment on their request.



I hope this helps those out there that may have been asking the same question.



Marshall