How do I map field values from a parent ticket to a new child ticket?

Tyler Michals
Kilo Guru

When I create a new child ticket, I would like some field values from the parent ticket to automatically be populated into the child ticket. How do I achieve this?

1 ACCEPTED SOLUTION

Here is a script from a UI Action which creates a change request from an incident.


It will guide you through the main points of what you want to do.



var change = new GlideRecord("change_request");
//change.short_description = current.short_description;
//change.description = current.description;
change.cmdb_ci = current.cmdb_ci;
change.priority = current.priority;
var sysID = change.insert();


var mySysID = current.update();


gs.addInfoMessage("Change " + change.number + " created");


var new_relationship = new GlideRecord('task_rel_task');
new_relationship.type = 'd798ba000a2581020048305ef5287403'; //use the sys_id of the relationship type from your instance here
new_relationship.parent = current.sys_id;
new_relationship.child = sysID;
new_relationship.insert();


action.setRedirectURL(change);
action.setReturnURL(current);


View solution in original post

12 REPLIES 12

Michael Fry1
Kilo Patron

You would have to do some update to the Parent to get child(ren) tickets updated with fields from the parent. There is an update of the box business rule: Update Child Incidents - you could modify that with the fields you want pushed to the child(ren).


Michael,



I cannot find a business rule called "Update Child Incidents" on the business rules table


Do you have a personal instance that you can review? Is the business rule inactive? I know it's been around for a while.


I requested a developers instance and found the business rule you are talking about. However, I think i am leaning more towards creating a UI action rather than a business rule, unless the business rule can map fields from the parent ticket to the child ticket immediately when a user clicks "New"