$attrs copy issue

Hello everyone!

I’m using the copyPaste feature of the modeler, and I’ve noticed that it’s not copying the attributes from $attrs.

let selection = this.bpmnModeler.get("selection");
let selected = selection._selectedElements;
let copyPaste = bpmnModeler.get("copyPaste");
copyPaste.copy(selected); //this is the function that doesn´t copy the $attrs
let copied = clipboard.get();

This is the original:
Captura de pantalla 2025-01-02 a la(s) 09.34.57

and this is the copied element:
Captura de pantalla 2025-01-02 a la(s) 09.35.25

Is there a way to customize/fix this behavior?

Properties in $attrs are not copied by default. Ideally they wouldn’t be added to $attrs in the first place. I assume you’re not using a model extension?

H!
Thanks for your response.

Yes, in fact I have defined the model extension. For example, here I show you the partial code:
Captura de pantalla 2025-01-02 a la(s) 13.39.00

And here I’m passing it to a bpmn-js instance in customFields

Captura de pantalla 2025-01-02 a la(s) 13.39.20

I should add that I also have defined a class that extends CommandInterceptor and has a function that is executed after shape.create that sets default values ​​for the properties using this:

modeling.updateProperties(shape, { // my properties }) 

Maybe this function is adding the properties to $attrs?

I’d inspect the element after creation and see where the properties end up to see if this is a copy & paste issue or a more general one.