Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Virtual Agent - AI(Now Assist) Submitted requests/Incidents number in the Chatbot

duggia
Tera Contributor

Hi All,

 

Virtual Agent - AI(Now Assist)
When we search with text create incident in virtual agent chat box. create incident link will be shown. when we click on the link it redirects to create incident record producer. once the incident is submitted related submitted ticket number should be showing in virtual agent.

1 REPLY 1

vaishali231
Kilo Sage

hey @duggia 

 

This is a known gap when using Virtual Agent with a Record Producer redirect. By default, Virtual Agent does not automatically display the created record details after the user is redirected and submits the form—you need to explicitly pass that information back to the conversation.

  Approach

To show the created Incident number in the Virtual Agent chat after submission, you can use the conversation context/session to pass data back.

  Steps

Preserve the Virtual Agent conversation

Ensure the sysparm_conversation_id is passed in the Record Producer URL so the user returns to the same chat session after submission.

Capture the created Incident

In the Record Producer script, capture the created record sys_id (or number).

Store it temporarily

Use session (e.g., gs.getSession().putProperty()) or another mechanism to store the Incident reference.

Retrieve in Virtual Agent

In your VA topic, add a script step after the user returns.

Fetch the stored value, query the Incident, and set it to a VA variable.

Display in chat

Use a bot response to show the Incident number (e.g., “Your incident INC0012345 has been created successfully”).

*************************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh