Need to update the sys_created_by field of sys_journal field table while posting the work notes to service now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2019 02:38 AM
We have developed a web application which uses the servicenow scripts to add the task as work note to the incident. After this, (hope) there is a trigger which saves the value in the sys_journal_field. We need to update the sys_created_by field in this table. But that is always getting updated with the name of the user who logged in. Can we change the sys_created_by by anyways (may be in the trigger which updates the value in the sys_journal_field)? If so, can you please advise the name of the trigger and the way in which this can be modified to update the details of the user name passed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2019 01:02 AM
Hi,
There exists a way:
myGR. .... //set your fields including sys fields
myGR.autoSysFields(false); //prevent system fields from reevaluating
myGR.update(); // or insert() ...
However, pay attention to the activity stream when using this:
This may break the auto update (comments poping up) of the activity stream or mess with the values.
We had a similar problem and we had to switch back to the classic work notes field display (and give up activity stream).
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2019 02:04 AM
Hi,
We are using the Table API of service now incident to create the new incident with work notes in service now from our web application. And we are not using any business rule to add the incident or the work note. This works fine. But when the work note is created in service now, the user which is shown as the creator of the work note, is always the user in whose name the credentials are being created to invoke the API. What we want is, to save and show the user name as the creator of the work note which we pass to the table API as sys_created_by filed value. Can we do that?