gs.getErrorMessages() returns empty value in Scripts - BackgroundIssue The gs.getErrorMessages() method returns an empty value when a script runs in Scripts - Background. The following script returns an empty value: gs.addErrorMessage('Test error message'); var errorMessages = gs.getErrorMessages(); gs.info('errorMessages ' + errorMessages); Output: Background message, type:error, message: Test error message *** Script: errorMessages [] Expected behavior: The method returns Test error message. Current behavior: The method returns an empty value. Release All supported releases Cause The gs.getErrorMessages() method requires an interactive session. A script that runs in Scripts - Background does not run in an interactive session, so the method does not return messages. Resolution Run the script in an interactive session, because gs.getErrorMessages() does not return messages in a non-interactive session. 1.Move the script to a context that runs in an interactive session.2.Run the script from that context.3.Confirm that gs.getErrorMessages() returns Test error message. To check whether a session is interactive, see the GlideSession API reference in Related Links. Related Links View GlideSession isInteractive API reference documentation