- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2021 03:20 AM
Hi All,
I have below requirement how to do that ,please suggest.
there is variable in catalog item called "are you summited Request or incident ?"
Based on selection of Incident i want to created incident
How to do that .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2021 03:43 AM
You can use Run Script in your workflow with sample script below
if(current.variables.variableName == 'Your Value'){
var inc = new GlideRecord('incident');
inc.initialize();
inc.short_description = 'Testing';
inc.insert();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2021 03:33 AM
Hi accsukant,
In the workflow for the item you can have an if statement to check the answer of that variable, if it is request continue to create the catalog task, if it is incident, can create an incident via the create task activity and then close the REQ and RITM with a worknote explaining incident created.
I don't think there is a way to stop the creation of the REQ and RITM if the submission is via a catalog item form. Ideally you would want your end users to be using the correct forms to submit either a request or an incident. An alternate perhaps would be if they should be creating an incident have a link to the incident record producer rather than submitting the catalog item?
Hope this helps
Thanks
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2021 03:43 AM
You can use Run Script in your workflow with sample script below
if(current.variables.variableName == 'Your Value'){
var inc = new GlideRecord('incident');
inc.initialize();
inc.short_description = 'Testing';
inc.insert();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader