- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2024 11:39 PM
How to create Expedite Change from Incident.Expedite change is like Normal change.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 01:08 AM
It looks like you are setting your Change Request as a normal one (var changeRequest = ChangeRequest.newNormal()). Your setting of the type value isn't over writing that. Put this in as your script (make sure you also have a Change Model for Expedite):
var changeRequest = new GlideRecord('change_request');
changeRequest.initialize();
changeRequest.setValue("type", 'expedite'); // or the value you have given it
changeRequest.setValue("chg_model", 'sys_id_of_expedite_change_model');
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.cmdb_ci);
if (changeRequest.hasValidChoice('priority', current.priority))
changeRequest.setValue("priority", current.priority);
changeRequest.setValue("sys_domain", current.sys_domain);
changeRequest.setValue("company", current.company);
var sysId = changeRequest.insert();
current.rfc = sysId;
current.update();
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2024 11:51 PM
You will need to give more information. Does this has to be done automatically, or through a UI action? If it's a UI action, check on the OOB UI action for 'create change' on the incident table. For automation, I would create a flow that triggers on your conditions and creates the change, including all the fields you want to copy from the incident.
If it's something else: please elaborate on your requirement.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2024 11:54 PM
requirement is to create from UI Action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 12:16 AM
The system has a lot of examples:
https://[your_instance].service-now.com/sys_ui_action_list.do?sysparm_query=nameLIKEchange%5EnameSTARTSWITHCreate&sysparm_view=
Even 4 on the incident table:
https://[your_instance].service-now.com/sys_ui_action_list.do?sysparm_query=nameLIKEchange%5EnameSTARTSWITHCreate%5Etable%3Dincident&sysparm_view=
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 12:24 AM
My issue is i have Type field on Change form, when i create a new UI action similar to Normal Change.Type field on change form is getting updated to Normal,not Expedited.