How to change the default fields in the new template creation form in change management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
Need a help please. Iam trying to change the fields in the new template creation popup in the change management. Once change is opened, in the template bar, click on + sign and a new template creation form appears and it will have default fields. i am looking to modify them.
Any suggestion s would be of great help.
Thanks & Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello @Raahul2 , The template field captures live updates from the Change form and If I remember correctly, loads them via a filter.
Could you please try the script below to see if it solves the additional problem? It should work fine as long as the Model field is active and not disabled (as it is during the Scheduled state). Also, the template field loads data within a specified timeout period.
function onLoad() {
setTimeout(function() {
var encodedQuery = g_form.getValue('template');
var standardModelSysId = 'e55d0bfec343101035ae3f52c1d3ae49';
if (g_form.isNewRecord() && g_form.getValue('table') == 'change_request' && encodedQuery.indexOf('chg_model=' + standardModelSysId) !== -1) {
g_form.addInfoMessage('Template found');
var newTemplateValue = "short_description=Critical Outage^impact=1^urgency=1^EQ";
g_form.setValue('template', newTemplateValue);
}
}, 500);
}
In fact, we could have tried On Change script as well on Template field.
Regards,
Nishant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello @Raahul2 , just a small modification ( adding g_form.isNewRecord() ) so that it runs for new template not for the existing ones
function onLoad() {
if (g_form.isNewRecord() && g_form.getValue('table') == 'change_request') {
var newTemplateValue = "short_description=Critical Outage^impact=1^urgency=1^EQ";
g_form.setValue('template', newTemplateValue);
}
}