Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Agent Presence Histories table not creating records when agents go into "Available" state - Known Error
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Agent Presence Histories table not creating records when agents go into "Available" state
KB0830897

Agent Presence Histories table not creating records when agents go into "Available" state


1160 Views Last updated : Jan 15, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

Agent Presence Histories table not creating records when agents go into "Available" state, it only records when Away or Offline.


Logs show below error:

JavaScript evaluation error on:
(function executeRule(current, previous /*null when async*/) {

var agent = current.getValue('agent');
var presence = current.getValue('current_presence_state');
var channels = [];
var gr = new GlideRecord('awa_agent_channel_availability');
gr.addQuery('agent', agent);
gr.addQuery('presence_state', presence);
gr.addQuery('available', true);
gr.query();
while(gr.next()) {
if(channels.indexOf(gr.getValue('service_channel')) == -1) {
channels.push(gr.getValue('service_channel'));
}
}
var grHistory = new GlideRecord('awa_agent_presence_history');
grHistory.initialize();
grHistory.setValue('agent', agent);
grHistory.setValue('presence_state', presence);
grHistory.setValue('available_channels', channels);
grHistory.insert();

})(current, previous);
Root cause of JavaScriptException: java.lang.NullPointerException
: java.lang.NullPointerException:

Release

All supported

Cause

awa_agent_channel_availability table contains records where the "Service Channel" column is empty. This column should always contain a value that corresponds to one of the Service Channels.

Resolution

- Navigate to https://instance_name.service-now.com/awa_agent_channel_availability_list.do?sysparm_query=service_channel%3DNULL&sysparm_view=
- Remove these records

Once completed, you can remove the filters from the list and you will see that the remaining records have a value on the Service Channel column and Agent Presence history will be populated correctly.



The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.