- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 10:40 AM
As the title states, I would like to know how to put the original short description contents into the activity log is changed, after the short description is changed on an Incident form. I'm new to Service Now and have a few ideas about how to go about this so far, but I feel lost.
Here's what I'm considering so far.
1. Create a Client Script that contains an onChange() function. The problem is that I'm not quite sure how to specifically target Short Description with the Client Script. I'd like to compare oldValue to newValue, and then if theyre not equal, add oldValue to Activity Log. However, the UI of Service Now and its options confuse me alot, but how would Service Now know I only want this to apply to Short Description so that oldValue always equals the orginal version of Short Description? So as a result, I'm afraid Service Now would write the original contents of all changed fields to the activity log.
2. UI Policy
Figured I could create a condition to check if Short Description is changed, and if so put the original contents into activity log. The problem here though is that there is no implementation of oldValue(), so how would I retrieve it?
3.Business Rule
Same deal as UI Policy, however I'm even more unfamiliar with Business Rules.
Any links to articles or suggestions that could point me in the right direction would be greatly appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 11:39 AM
Hi Rev,
The best way is to personalize the activities.
and bring the short description field into the Selected values:
Regards,
Arpit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 10:47 AM
Hi Rev, the best way of doing this is through a business rule, although the client script is also a good option. i will write for you the script in few minutes.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 11:07 AM
Hi, try this on your business rule:
Condition:
Short Description changes
Type
OnBefore and Update type of business rule
Script: (Make sure you have checked Advanced to see the Script section)
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
current.comments = 'Short description has changed. Previous value was:' + previous.short_description;
}
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 12:24 PM
Thanks for helping out with this Berny. I looked over the script and the options you listed and it all makes sense now.
Thanks abunch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 11:26 AM
I guess this can also be done with activity formatters
http://wiki.servicenow.com/index.php?title=Activity_Formatter#gsc.tab=0
You will need to add short description field in activity formatter property.