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

Erroneous Warnings When Creating Issue Links #1875

Open
2 of 4 tasks
ssamsel-rtx opened this issue Jul 16, 2024 · 0 comments · May be fixed by #1876
Open
2 of 4 tasks

Erroneous Warnings When Creating Issue Links #1875

ssamsel-rtx opened this issue Jul 16, 2024 · 0 comments · May be fixed by #1876

Comments

@ssamsel-rtx
Copy link

Bug summary

When creating issue links, I get a warning log informing me that the issue link type I specify is not present in the list of link types, even if it is in fact present. This is due to the equality of the IssueLinkType class and strings not working. Even when passing in the type argument as the appropriate IssueLinkType, this warning still occurs as the translate_resource_args decorator converts it to a string. This can be fixed by changing the line issue_link_types = self.issue_link_types() to issue_link_types = list(map(lambda x: x.name, self.issue_link_types())) in the JIRA.create_issue_link method in client.py

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Server or Data Center (Self-hosted)

Jira instance version

No response

jira-python version

main

Python Interpreter version

3.10.12

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# 1. Given a Jira client instance
jira: JIRA
# 2. When I create an "is closely related to" issue link:
jira.create_issue_link("Closely Related To", "KEY-1", "KEY-2")
# 3. I get the erroneous warning
Warning: Specified issue link type is not present in the list of link types

Stack trace

n/a

Expected behaviour

I expect no warning, as the issue link is created correctly, and is in fact in the set of issue links returned by jira.issue_link_types()

Additional Context

No response

ssamsel-rtx pushed a commit to ssamsel-rtx/jira that referenced this issue Jul 17, 2024
Equality check between IssueLinkType and string always returns false.
Function decorator casts IssueLinkType parameters to string, so a
warning is always logged. This fixes that issue.

Closes: pycontribs#1875
Signed-off-by: Shymon Samsel <shymon.samsel@raytheon.com>
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

Successfully merging a pull request may close this issue.

1 participant