In an attempt to reduce friction and repetitive strain syndrome I would like to be able to programmatically change the "Safety related in this HW analysis" column when I have multiple safety goals.
The below script captures the safety goal from the first item selected, assumed to be chosen correctly by the user, and applies it to the remaining selected items. The script is doing what I'd expect it to.
Running medini in debug mode, I can see that selected items are having their safety goal updated, but the text in the "Safety related in this HW analysis" column is only updating if one and only one of the other safety goals are chosen prior to running the script. If the default of "all SGs" is in that column it will not update after the safety goal is selected.
In the image below the following can be seen:
RED ARROW: first item, containing the safety goal I want applied to all items in the image.
BLUE ARROW: this item had another safety goal (G024) originally applied and it updated when the script ran
ORANGE ARROW: this item was the default, i.e. both safety goals, when the script ran. The text in the column didn't change, but I can see through the debug mode that the element attributes were updated so the safety goal is G017 as desired. Component C158 is also exactly like this; it updated, but the column text did not.

I've tried refreshing as well as closing medini and restarting. Nothing is updating that column text.
Any insight you can provide would be appreciated.
//$EXPERIMENTAL$
// lets check the selection first
if (!selection) {
throw "No or invalid selection!";
}
// select parts
if (selection && selection.length) {
var componentEntries = Global.getFinder(selection).findByType(Metamodel.dc.DCComponentEntry);
if (componentEntries.isEmpty()) {
console.error("No elements to proceed");
}
console.log("Found {0} elements", componentEntries.size());
}
// get the safetyRelatedFor data from the first item
safetyGoalData = componentEntries.first().safetyRelatedFor;
desiredGoalName = componentEntries.first().safetyRelatedFor[0].identifier;
console.log("Safety Goal of ''{0}'' is {1}\nSafety Goal Info: {2}", componentEntries.first().element.name, desiredGoalName, safetyGoalData);
componentEntries.forEach(function reportBlock(componentEntry) {
if (componentEntry != componentEntries.first()){
console.log("Setting goal for ''{0}''", componentEntry.element.name);
componentEntry.safetyRelatedFor = safetyGoalData;
}
});