You can modify the LinkingTool.archetypeLinkData object. That’s the JavaScript object that is copied by LinkingTool.insertLink calling GraphLinksModel.copyLinkData.
For example, the Grafcet diagrams sample, Grafcet Diagrams, has three different selection adornment buttons, each of which creates a different kind of link. The code assigns the category of the link, so that a different template is chosen. But the same technique applies to modifying any other property of the data.
Well, Part.containingGroup for any Node or Link will return the Group, if any. Note that links that connect nodes that are in different groups belong to the common container, which might be null if no such group exists.
There’s no reason for that information to be stored on the link data objects in the model, because it is automatically calculated for you, accessible as the Part.containingGroup property.
var tool = flowchart.toolManager.linkingTool;
tool.archetypeLinkData = { pool: "" }; // updated in LinkDrawn event
// add Pool key to Links in diagram
flowchart.addDiagramListener("LinkDrawn", function (e) {
var link = e.subject;
var pool = flowchart.findNodeForKey(link.containingGroup.data.key);
flowchart.model.setDataProperty(link.data, "pool", pool.data.group);
});