Generate scripts from text, code, or a combination of both with AI-powered code generation.
When code generation is enabled on an instance, a Now Assist icon (
) appears in the script editor.
Developers must be assigned the now.assist.creator role to use code generation.
Generate scripts from text
Write scripts quickly with AI-generated code by telling Now Assist what you want the script to do.
Procedure
-
Navigate to a form with a script field.
For example, to open a script include form, navigate to and select New or enter sys_script_include.do in the navigation filter.
-
In the script editor, place your cursor where you want to add code.
-
Right-click and select Open Code with Now Assist or use one of the following keyboard shortcuts:
- Windows: Ctrl-Enter
- Mac: Cmd-Enter
Tip: Select the Help icon (

) to access the list of relevant keyboard shortcuts.
-
In the Code with Now Assist dialog box, enter text that describes the desired goal of the code to generate.
The text you enter must be fewer than 1,000 characters.
-
Press Enter to generate a code suggestion.
The code suggestion appears highlighted in the script editor.

-
Review the code suggestion and complete one of the following steps:
- To include it in your script and make any edits, select Accept.
- To regenerate a suggestion, revise the text in the dialog box and select the arrow icon (
).
- To remove it from the script, select Reject.
When you accept a code suggestion, a line next to the line numbers indicates which code was created by AI and hasn't been edited. If you edit AI-generated code, the line indicator doesn’t appear for those lines
of code.

If the code suggestion doesn’t meet your requirements, try rephrasing your prompt according to the prompt guidance and generating another code suggestion.
-
Select Submit or Update to save your changes.