Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting linked items fails with deleted items #138

Closed
mrtnnwmn opened this issue Sep 29, 2023 · 8 comments
Closed

Getting linked items fails with deleted items #138

mrtnnwmn opened this issue Sep 29, 2023 · 8 comments
Labels

Comments

@mrtnnwmn
Copy link

I'm using getLinkedItemWithRoles() and on a particular work item I get the error below:

    470 if self.linkedWorkItemsDerived is not None:
    471     for linked_item in self.linkedWorkItemsDerived.LinkedWorkItem:
--> 472         linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI)))
    473 return linked_items

AttributeError: 'NoneType' object has no attribute 'id'

Looking at the work item in Polarion it seems that there are links to two items that have been deleted, so I assume the method is failing when it attempts to add the deleted items to the linked work items list. Could you add a check for work item validity?

@jesper-raemaekers
Copy link
Owner

I was not able to reproduce it, but I added a check that should solve this exception.

Copy link

github-actions bot commented Nov 8, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 8, 2023
@alexandertoepfer
Copy link

alexandertoepfer commented Nov 9, 2023

I have had the same issue, it happens because links in polarion do not guarantee the workitem exists, I would advise to check in your system for such dangling links, otherwise you can always hack "try: ... except: continue" around the list append.

Edit: If you do need more info to reproduce this, I'll be glad to help provide more insights

@github-actions github-actions bot removed the stale label Nov 10, 2023
@jesper-raemaekers
Copy link
Owner

I think this happens when items are deleted using the API. it seems that the GUI of Polarion also cleans up all references, but this may not be the case for the API. Did @z3r0k3ys experience this issue with the latest package version?

@alexandertoepfer
Copy link

I will be able to provide an answer by Monday, because unfortunately I'm using a forked version with the try except block to avoid this issue, but I can guarantee the problem is not the package, it's rather that those references are allowed to exist in the first place, which should be addressed by polarion

@alexandertoepfer
Copy link

You could add a flag for safety to turn missing items into just a warning, but from my point of view this can be closed

Copy link

github-actions bot commented Jan 9, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 9, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants