- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 05:59 PM - edited 03-07-2023 07:56 PM
Can anyone help me in how to show RITM number in short description on change request form.
To auto populate Change Request Planned Start Date depending upon the RITM creation date
aAs mentioned in below screen shot the highlighted fields should get auto populate when the User select the option in Catalog Item @Ankur Bawiskar @BharathChintala @Anil Lande @Sumalatha Y @mattystern @SatyakiBose @asifnoor @Pradeep Sharma
as the Impact Business Unit field is refered to a below mention varaible
in the data lookup table when the User selects Group then the Local/Regional CAB field should populate Regional CAB other wise it should populate Local CAB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 03:15 AM
Hi @Arjun Reddy Yer ,
.
In the screenshot above you haven't created any GlideRecord reference for change record, but you are calling a variable called "changeGlideRecord", so it's throwing error in that step of work flow.
If you want to create a change Request along with the Task, You should write code something like this.
var changeGlideRecord = new GlideRecord();
changeGlideRecord.initialize();
changeGlideRecord.short_description = current.number + 'Standard Change Request for Firewall Change Request';
changeGlideRecord.satrt_date = current.created.addDays(11);
/* Populate all the change field values here like this*/
....
....
changeGlideRecord.insert();
For the Local/Regional CAB field, as you said the company is a reference field, there should be some criteria to identify which is the group company and which is not. If you can share us that we can help in writing the logic to populate the Local/Regional CAB fields.
Thanks,
Anvesh
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 09:44 PM
Hi @Arjun Reddy Yer,
How you are processing the catalog item, I mean Workflow/Flow/Template?
Assuming you are using Workflow triggered on RITM,
1. For the RITM in short description you can simply append the short description variable (current.variables.<Your_catalog_variable_for_short_description>) and "current.number" and assignigning it to the change record
var changeGlideRecord = new GlideRecord('change_request');
changeGlideRecord.initialize();
changeGlideRecord.short_description = current.variables.<Your_catalog_variable_for_short_description>) + ' - ' + current.number;
....
....
....
changeGlideRecord.insert();
2. For Planned start date, if you want it be 7 days after RITM creation date,
....
....
changeGlideRecord.start_date = current.created.addDays(7);
....
....
3. For the Local/Regional CAB field, you can use the following code (if the company variable in catalog item is of list type or multi select)
var compant_arr = current.variables.company.split(',');
if(compant_arr.length > 1){
//populate the Local/Regional CAB with "Regional CAB"
}else{
//Populate the Local/Regional CAB with "Local CAB"
}
Thanks,
Anvesh
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 07:49 AM - edited 03-08-2023 07:53 PM
2. For Planned End Date, it should be 11 days after RITM creation date
as the script is not working as I had written the script as mentioned in below screen shot
3. For the Local/Regional CAB field, you can use the following code (if the company variable in catalog item is of list type or multi select)
It's Look up data reference table as mentioned in the screen shot of posting the question
the Local/Regional CAB field is String Type

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 11:18 PM
Hello @Arjun Reddy Yer
Firstly, can you tell me how are the RITM and change record related?
Are you talking about a record producer that will be created a change record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 11:31 PM
RITM populated in parent field of Change Request in workflow as mentioned in below screen shot
created workflow:
When the RITM got approved then SCTASK and Change request are getting created automatically via workflow