Autopopulate field from incident form on new problem form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 09:30 PM
Hi All,
In incidents the problem_id field is a reference to the problem table. When clicking on the magnifying glass a list of problem records appear. If I click on the NEW button from this list a form appears,i want to autopopulate some fields such as configuration item, short description, Impacted service from previous incident form.
Any suggestions.
Thanks in advance.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 09:40 PM
Hi Arohi,
You can create Display BR to capture the values from incident form in g_scratchpad and the use then in onLoad client script to auto populate the data when New Problem form loads.
Please try in this way:
Kindly TRY with below code in Displace BR on Problem Table.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('incident'); // Please enter the parent table name
gr.get(parent.sys_id);
g_scratchpad.value1 = gr.getValue('<name of the reference field from parent table>');
g_scratchpad.value2 = gr.<name of the string field from parent table>;
})(current, previous);
Client Script: on Problem Table.
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.isNewRecord()){
g_form.setValue('<name of the string field on child table>', g_scratchpad.value1 );
g_form.setValue('<name of the string field on child table>', g_scratchpad.value1 );
//g_form.setValue('<field name of Reason>', 'Release');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 09:42 PM
Hi Shishir,
Thanks for your quick response, but this is not working, its not fetching values.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 09:58 PM
Hi Arohi,
I think that's not possible because when you click on NEW button it's open a new Problem Form to create new Problem Record which is not related to Parent table (Incident). In that case you have to add Problem table in Related list and click New Problem record from there, in that case that will related to parent table and fields from the parent table to child table can be populated.
when you create from related list table it gets relate/referenced to parent table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 10:07 PM
oops!! Thank you for this clarification.