How to associate a child incident to a parent.

Prithvi Ramesh1
Mega Sage

For example, we have an Excel file with two fields containing serial numbers. If one of the fields matches, the corresponding record should be associated with the incident ticket and set as its parent. This should be achieved using the transform map script.

4 REPLIES 4

Shashank_Jain
Kilo Sage

@Prithvi Ramesh1 , yes it can be achieved by using  onBefore script for your Transform Map.

 

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain

I already wrote this script but hopefully it is not working could you please check it below - 

 

if (source.u_pluginid == target.getValue('short_description')) {
        log('Prithvi' + target.getValue('short_description'));
        var gr = new GlideRecord('incident');
        gr.insert();
        gr.parent_incident = target.getUniqueValue();
        log('Prithvi' + target.getUniqueValue());
        gr.insert();
    }

@Prithvi Ramesh1 , It is not looking the correct script for above scenario. What's your exact requirement is?

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain

Hello @Shashank_Jain  , Please refer to the screenshot below. The first record should be treated as the parent record, and any other records with the same Plugin ID should be associated as child records.

PrithviRamesh1_0-1755626123046.png