diff --git a/polarion/workitem.py b/polarion/workitem.py index 56a895d..6f1ec30 100644 --- a/polarion/workitem.py +++ b/polarion/workitem.py @@ -475,10 +475,12 @@ def getLinkedItemWithRoles(self): service = self._polarion.getService('Tracker') if self.linkedWorkItems is not None: for linked_item in self.linkedWorkItems.LinkedWorkItem: - linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) + if linked_item.role is not None: + linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) if self.linkedWorkItemsDerived is not None: for linked_item in self.linkedWorkItemsDerived.LinkedWorkItem: - linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) + if linked_item.role is not None: + linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) return linked_items def getLinkedItem(self):