- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 03:26 AM
I want to create an incident with variable section through virtual agent, the same way we create through record producer.
I tried the the way by which we create RITMs but it's not working.
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 04:14 AM
Several ways possible. Also depending on where the information for those variables would come from.
Though, easiest would be to add a question_answer record scripted. Like below. This would already be similar as having variables when submitted through a record producer.
Personally I would consider doing this more dynamically, fetching the variables from the record producer, etc.. Though below would already work.
var grAnswer = new GlideRecord('question_answer');
grAnswer.initialize();
grAnswer.setValue('table_name', 'incident');
grAnswer.setValue('table_sys_id', 'sys_id_of_your_created_incident, maybe something like vaInputs.create_incident');
grAnswer.setValue('question', 'sys_id_of_the_variable');
grAnswer.setValue('value', 'value_for_the_variable');
grAnswer.setValue('order', '100/200/300/etc');
grAnswer.insert();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 03:29 AM
Hi there,
Can you share what you've tried?
This should be achievable by just creating the Incident (either scripted or using the utility for this), and adding question_answer records.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 03:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 03:56 AM
This is Cart related, not Incident. So don't see this working.
So how about what I already mentioned? Just creating the Incident (either scripted or using the utility for this), and adding question_answer records. Did you try this already?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 04:05 AM
I got your point, We are already creating incident via Utility. But how to add variable section(Question answer records)? Can You please elaborate this or if you have sample code, please share.