onChange client Scripts are executing twice on Date Variables when their value is cleared or changed as part of the script in Service Portal

Steps to Reproduce

  1. Log in to an OOTB London instance (verified in demonightlylondon)
  2. Open the record producer 'Create incident'
    • https://<instance-name>
  3. Create a Date variable, say 'start_date'
  4. Create an onChange catalog client script on the above Date variable as follows:
    • Name: test alert
    • UI type: all
    • Type: onChange
    • Variable name: start_date
    • Script:
      function onChange(control, oldValue, newValue, isLoading) {
      if (isLoading || newValue == '') {
      //Type appropriate comment here, and begin script below
      if(newValue) {
  5. Open the Record Producer from the Service Portal
  6. Select a date for the above Date variable

Expected behavior:
When you change the value of Date Variable 'start_date', the alert should show once.

Actual behavior:
When you change the value of Date Variable 'start_date', the alert shows twice.

Note: The issue is seen only on Date variables. If we repeat the same steps for a Single Line Text variable, the alert is shown only once.


This issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In field to determine whether any versions have a permanent fix.

Related Problem: PRB1301582

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:38:19