- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 01:12 AM
Please help me out in creating a change request from problem but not inserting it. Since the Ui action which creates a change record is saved through it that runs, the mandatory fields not filled in and continue to show as required. It should navigate to sys_is -1.
Below is the code and I have commented out line where it inserts.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 04:52 AM
you are not inserting so you won't get the CHG number
so these lines makes no point
var change = new GlideRecord("change_request");
change.short_description = current.short_description;
change.description = current.description;
change.cmdb_ci = current.cmdb_ci;
change.priority = current.priority;
change.company = current.company;
change.sys_domain = current.sys_domain;
change.parent = current.sys_id;
change.type = 'Normal';
//var sysID = change.insert();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 01:36 AM
Hello @Annirnita Dash1
i just correct the few thing in above code is like type of Normal in backend is normal
and please mention what EXACULTY issue you are getting ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 03:07 AM
Hi,
yes the type is normal. the UI action create normal change.
I want it t to a new change record with prefilled data (few of fields) and wont create one. so the url shall show sys_id -1. Once I fill in required fields (other than pre filled), I should submit it and then a change will be created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 03:22 AM
Hi @Annirnita Dash1 , Did you try to use templates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 03:24 AM
Hi Gopika,
No, I have not done anything apart from above script.