---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Edit code with Now Assist

# Edit code with Now Assist {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Edit scripts quickly by telling Now Assist how to improve the code.

## Before you begin

Role required: now.assist.creator

## About this task

When code generation is enabled on an instance, a Now Assist icon (![Now Assist icon.]()) appears in the script editor.

## Procedure

1. Navigate to a script.  
   For example, to open a script include form, navigate to AllSystem DefinitionScript Includes and select a script include.
2. In the script editor, highlight the code to edit.
3. Right-click and select Open Code with Now Assist or use one of the following keyboard shortcuts:
   * Windows: Ctrl-Enter
   * Mac: Cmd-Enter

   {#edit-code-now-assist__choices_irg_s5p_qbc}  
   Tip:  
   Select the Help icon (![Help icon.]()) to access the list of relevant keyboard shortcuts.
4. In the Edit code with Now Assist dialog box, enter text that describes how you want to refactor the code.  
   The text you enter must be fewer than 1,000 characters.
5. Press Enter to generate an edited code suggestion.  
   A view comparing the original code and the edited code suggestion appears in the script editor.

6. Review the edited code suggestion and complete one of the following steps:
   * To overwrite the original code with the edited code suggestion, select Accept.
   * To regenerate a suggestion, revise the text in the dialog box and select the arrow icon (![Arrow icon.]()).
   * To remove the edited code from the script and keep only the original code, select Reject.

   {#edit-code-now-assist__choices_asf_fvp_qbc}  
   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.
7. Select Submit or Update to save your changes.
{#edit-code-now-assist__steps_r53_ts4_xbc}

*[\>]: and then


