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

Jira pack : Python error AttributeError: 'PropertyHolder' object has no attribute 'labels' #53

Closed
Shiveta80 opened this issue Jun 26, 2023 · 3 comments

Comments

@Shiveta80
Copy link

Hello,

We have had to edit some py files from the "jira" pack that reference or try to access the "labels" property of the "issue.fields" object.
When we run actions like "update_field_value.yaml" or "create_issue.yaml", we get the following error:

AttributeError: 'PropertyHolder' object has no attribute 'labels'

Our workaround has been to omit that property if it doesn't exist. Something like that:
issue.fields.labels if hasattr(issue.fields, 'labels') else ''

Could you give us a solution to this problem?

Thanks in advance.
Best regards,

Shiveta80

@floatingstatic
Copy link
Collaborator

Hi apologies, for some reason notifications for this issue did not arrive in my mailbox. Let me see if I can reproduce this problem and get back to you. I'll try to look into this either later today or tomorrow at the latest. Again apologies for the lack of response here.

@floatingstatic
Copy link
Collaborator

@Shiveta80 I tested real quick just now. I cannot reproduce the problem you are seeing when running the create_issue action. For update_field_value I am not seeing this either, at least when updating fields other than labels. For example I can update description without any sort of error, however I notice that labels field will not update because labels has to be passed a value as an array of strings so jira returns a 400 to me. That is something I will probably track under a separate issue since I think it is not quite what you are seeing. I wonder if this may have something to do with the version of Jira you are using or something. I am testing using a cloud hosted free-tier account on atlassian.net. I suspect perhaps labels are not enabled in your environment or something? When you view an issue in your jira web ui, is labels even visible?

We can certainly add a patch to workaround the lack of a label field (PR from you would also be welcome if you are up for it). I can try to take a pass at this but unfortunately I cannot reproduce your exact problem which makes producing a patch a little challenging.

@floatingstatic
Copy link
Collaborator

@Shiveta80 i think this should be fixed in #59 (pack version 2.4.0). I'm closing this issue. Please re-open if you run into any more related issues.

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

No branches or pull requests

2 participants