When a user submit the request, the RITM number should be autopopulated in the work notes.
This content was last updated in 2022. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 11:24 PM
When a user submit the request, the RITM number should be autopopulated in the work notes of that change request i.e. RITMXXXXXXXX is created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 11:29 PM
Hi Priyanka,
You can achieve it using a Business rule, here is the code and configuration:
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 11:31 PM
Hi,Priyanka
You can use After insert Business rule for this.
write a On insert BR on sc_req_item.
and in the script :
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var req = current.number;
gs.log("myreq::"+req);
current.work_notes = "Requested item : "+req;
current.update();
})(current, previous);
Please Mark it helpful or correct.
So it could help others as well.
Thanks
Anand Shukla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2022 12:21 AM
Hello,
But according to my requirement it should be populated in the work note of the change request form.
Regards,
Priyanka shukla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2022 12:50 AM
Alright, So if you need to capture the RITM in every change request or on any specific request so based on that you can change the script of BR and populate the work_notes of change.
Use the below Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var req = current.number;
gs.log("myreq::" + req);
var gr = new GlideRecord('change_request');
gr.addQuery('sys_id','c83c5e5347c12200e0ef563dbb9a7190' );//your change re sys_id
//gr.addQuery('sys_id',gs.getProperty('property name where you store your change request number sys_id') ); // recommended way to store sys id in property and use it
gr.query();
if (gr.next()) {
gr.work_notes="Requested item : " + req;
}
gr.update();
//
})(current, previous);
Mark it helpful and Correct.
Thanks and regards
Anand