- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 03:51 AM
Please help to achieve below scenario:
Incident task to have Configuration item field on the form which will auto-populate with Incident CI at the time of creation from an Incident.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 05:55 AM
Hi,
1. Create a onBefore business rule on incident_task table.
And add below line of script in Advanced tab
current.cmdb_ci=current.incident.cmdb_ci;
This method shows the field value on form once you save the record.
2. If you want to auto populate the CI value as soon as form load , then use 'display' business and write onLoad client script to populate
And add below line of script
g_scratchpad.CIpopup=current.incident.cmdb_ci;
And then onLoad client script:
g_form.setValue('cmdb_ci',g_scratchpad.CIpopup);
You can also use GlideAjax or getReference methods
If I have answered your question, please mark my response as correct and/or helpful.
Thanks,
Suseela P.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 04:15 AM
Hey,
You can do this a few ways, but it somewhat depends on how you are creating the Task child record in the first place.
If you have this via a workflow, with say flow designer, you can just have the TASK field copy from the inherited parent.
You could use a Before Update Business Rule on the incident table like below
var gr=new GlideRecord('u_incident_task');
gr.initialize();
gr.short_description=current.short_description;
gr.cmdb_ci=current.cmdb_ci
gr.insert();
If it returns the sys.id might need to change around to be a getvalue type of syntax.
How are you creating the Task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 05:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 06:41 AM
Cool so you will need to create a Business Rule, which will see the linked Task and then auto populate the CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2020 05:55 AM
Hi,
1. Create a onBefore business rule on incident_task table.
And add below line of script in Advanced tab
current.cmdb_ci=current.incident.cmdb_ci;
This method shows the field value on form once you save the record.
2. If you want to auto populate the CI value as soon as form load , then use 'display' business and write onLoad client script to populate
And add below line of script
g_scratchpad.CIpopup=current.incident.cmdb_ci;
And then onLoad client script:
g_form.setValue('cmdb_ci',g_scratchpad.CIpopup);
You can also use GlideAjax or getReference methods
If I have answered your question, please mark my response as correct and/or helpful.
Thanks,
Suseela P.