id summary reporter owner description type status priority component severity resolution keywords cc release 5599 Deleting a blocking/blocked by ticket does not fully destroy the relationship emil@… Noah Kantrowitz "When deleting a relationship in a blocking/blocked by field, the following things should happen: 1. The blocking/blocked by field of the current ticket should be removed (and change history updated) 2. The blocked by/blocking field for the referenced ticket should be removed (and change history updated) 3. The relationship in the mastertickets table should be removed. Currently, only #1 is happening. The code for this scenario in model.py appears to work fine, the problem is that the ticket_changed function in api.py only adds to the blocking/blocked_by attributes of the link, apparently expecting these sets to be empty. TicketLinks init function, however, populates these attributes with the existing relationships and makes a copy so it can determine the delta on an update. The net effect is that you can never really delete a relationship. To make matter worse, post_process_request is reporting changes based on the text fields, so the user sees relationships ""added"" and ""removed"" when in fact only the ticket property changed. In our local environment, I added the following two lines before the for loops in the ticket_changed function: links.blocking.clear() links.blocked_by.clear() The full function now looks like this: def ticket_changed(self, tkt, comment, author, old_values): db = self.env.get_db_cnx() links = TicketLinks(self.env, tkt, db) links.blocking.clear() links.blocked_by.clear() for s in set(self.NUMBERS_RE.findall(tkt['blocking'] or '')): links.blocking.add(int(s)) for s in set(self.NUMBERS_RE.findall(tkt['blockedby'] or '')): links.blocked_by.add(int(s)) links.save(author, comment, tkt.time_changed, db) db.commit() " defect closed highest MasterTicketsPlugin blocker invalid 0.11