---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Code edit

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

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Quickly enhance your scripts by instructing Now Assist on how to improve the code.

## Vorbereitungen

Role required: now.assist.creator

## Warum und wann dieser Vorgang ausgeführt wird

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

## Prozedur

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, use one of the following options to edit code:
   * Select the code that you want to edit. Right-click and select Open Code with Now Assist.  

   * Select the code and then select the Quick Actions button.
   * Select the code and use one of the following keyboard shortcuts:
     * Windows: Ctrl-Enter
     * Mac: Cmd-Enter
     {#edit-code-now-assist__ul_mtc_dqq_rfc}

   {#edit-code-now-assist__choices_v3d_5pq_rfc}  
   Tipp:  
   Select the Help icon (![Help icon.]()) to access the list of relevant keyboard shortcuts.
3. 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.
4. Press Enter to generate an edited code suggestion.  
   A view comparing the original code and the edited code suggestion appears in the script editor.

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

