How to get action name in a Business Rule (Server Side script)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 09:57 AM
I know 'g_form.getActionName()' can be used in client-side script to identify the action name, what is the equivalent command on a server-side script ? I will need to identify the action that triggered the business rule to add a condition (on the business rule condition field or the script) based on that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 10:01 AM
Use current.operation() function to get the action name in server sided script.
Please go through below link for your reference.
Scripting in Business Rules - ServiceNow Wiki
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 12:05 PM
Thank you Mihir for your quick response. I used the 'current.operation('copy_change_request')' in the following context and found it returned null. Any thoughts?
I am implementing a Business Rule as discussed in the question - Point Create New to Record Producer. I am adding a condition in the business rule (when action='copy_change_request') to not to redirect to Record Producer when the 'Copy Change' (It also creates a new Change but copies from another change) is the UI Action or the Trigger.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 12:21 PM
Hi Hari,
current.operation(): // It retrieves the current operation being performed, such as insert, update, delete, etc.
In your use case you have to identify the field you want to decide the action upon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 01:46 PM
Thank you Pradeep. I will need to identify the event causing the new record being created on the change and handle accordingly. In this case, I need to identify the 'Copy Change' UI Action as the trigger creating the new change. Do you have any thoughts on how to achieve this ?