Thursday, November 9, 2017

Service Now Business Rules Assignments



BUSINESS RULES:-

1) Create a after update business rule on incident table such that, when ever the incident goes into "Closed" state, we will trigger a email saying to caller of the incident -

Hi <caller first name>,

We are happy to Help you.
Please contact us for any more details.

Thanks.


2) Create a before query on business rule on incident table, such that users who are having itil role, should see only ACTIVE incidents.

3) Create a before insert business rule on incident table, such that one user should not be able to raise more than 4 incidents in a day.

4) Create a ASYNC insert business rule on user table, such that whenever user's last_login time changes, user should be notified with an email saying "Your account has been logged in at : <updated last_login time>".

5) Create a before update business rule on problem table, such that only user's having role - (problem_manager) should be able to update it.

Monday, November 6, 2017

How to work with Events in Service Now ?



·        One use for system events in the ServiceNow platform is to control email notification for system activity, such as when incident records are updated, or change requests are assigned.

·        There are  number of useful OOB events that provides you with a broad view of application activity
·        If existing events do not meet your needs, you can create your own events to watch for specific changes to ServiceNow records.

·        Administrators can create a custom event to send an email notification if an existing business rule does not provide the necessary event. For example, you might want to notify people who initiate a service catalog request whenever a comment is added to that request.

·        For checking if an event can be used or not, first it needs to be registered under: “Event Registry”
·        Events can be called from various Server Side operations like: Business Rules, Script Includes or Workflows

·        A Sample script is as below:
if (current.operation() != 'insert' && current.comments.changes()) {
gs.eventQueue("incident.commented", current, gs.getUserID(), gs.getUserName());
}

·        An event when triggered from any of these scripts, can either trigger a notification or execute an event script


The gs.eventQueue function takes the following parameters: