Closed rynkk closed 1 year ago
I was able to reproduce this issue.
The same behavior is seen if you retrieve the issue link type using issue_link_type(id), as well.
Sorry for the delay, I did not manage to find time, yet. I hope I will be able to work on it within the next two weeks and also catch some other related oversights in the process.
Jannik Meinecke (jannik.meinecke@mercedes-benz.com) on behalf of MBition GmbH. Provider Information
The same behavior is seen if you retrieve the issue link type using issue_link_type(id), as well.
@dmcbride64 can you elaborate on this? I am unable to reproduce your issue.
Jannik Meinecke (jannik.meinecke@mercedes-benz.com) on behalf of MBition GmbH. Provider Information
The same behavior is seen if you retrieve the issue link type using issue_link_type(id), as well.
@dmcbride64 can you elaborate on this? I am unable to reproduce your issue.
Jannik Meinecke (jannik.meinecke@mercedes-benz.com) on behalf of MBition GmbH. Provider Information
@rynkk
Get a list of valid link types:
link_types = jira.issue_link_types()
print(link_types)
[<JIRA IssueLinkType: name='Blocks', id='10000'>, <JIRA IssueLinkType: name='Cloners', id='10001'>, <JIRA IssueLinkType: name='Duplicate', id='10002'>, <JIRA IssueLinkType: name='Issue split', id='10300'>, <JIRA IssueLinkType: name='Relates', id='10003'>]
Pick any valid link type 'id' from the list and use it to create an issue link:
link_type = jira.issue_link_type(10000)
jira.create_issue_link(link_type, "SANDBOX-255", "SANDBOX-257")
TypeError: Object of type IssueLinkType is not JSON serializable
@dmcbride64 I see, thanks for the clarification. This seems like the exact same problem as I described (calling it with the IssueLinkType-object). So seeing how the PR was merged, it should work again if you update your jira version!
Jannik Meinecke (jannik.meinecke@mercedes-benz.com) on behalf of MBition GmbH. Provider Information
@rynkk
Yes, I believe that's true. Just a slight wrinkle on the original issue. Only mentioned for completeness.
Bug summary
According to the type annotations of JIRA.create_issue_link the method accepts the type-argument either as a string or as an
IssueLinkType
object. If you pass an instance ofIssueLinkType
it will not be translated and thus cause a Serialization-Exception when trying to post.I can submit a PR with the solution mentioned below and new tests next week, probably.
Jannik Meinecke (jannik.meinecke@mercedes-benz.com) on behalf of MBition GmbH. Provider Information
Is there an existing issue for this?
Jira Instance type
Jira Cloud (Hosted by Atlassian)
Jira instance version
No response
jira-python version
3.4.0
Python Interpreter version
3.9
Which operating systems have you used?
Reproduction steps
Stack trace
Expected behaviour
Fitting to the current way to handle automated convertion; IssueLinkType should probably be parsed into its name by
translate_resource_args
.Might be sensible to check for other cases of this, too.
Additional Context
No response