You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The create_issue_link function crashes when an IssueLinkType object is passed to the function as the link type.
There has been a similar previous issue #1604 which was fixed by converting the IssueLinkType to a string when calling the create_issue_link function using positional arguments. In this case, the create_issue_link function displays a warning and figures out the correct IssueLinkType on its own.
If an IssueLinkType is handed to create_issue_link using named arguments, the automatic conversion of the arguments is skipped (as it was added in #1604). The warning in create_issue_link is not displayed as the provided link type is found in the list of valid link types. In the next step, the IssueLinkType is however passed directly to the post function and thus creates a TypeError: Object of type IssueLinkType is not JSON serializable
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
9.4.15
jira-python version
3.6.0
Python Interpreter version
3.11
Which operating systems have you used?
Linux
macOS
Windows
Reproduction steps
jira: JIRAjira_link_type=jira.issue_link_types()
# take any valid link typelink_type=link_types[0]
issue1="key1"issue2="key2"# link the issuesjira.create_issue_link(
type=link_type,
inwardIssue=issue1,
outwardIssue=issue2
)
In the create_issue_link function the type of the variable "type" needs to be checked before creating the data Dictionary. If it is of type IssueLinkType, the data Dictionary needs to be handed the name of the link type instead of the IssueLinkType object, e.g.:
Bug summary
The create_issue_link function crashes when an IssueLinkType object is passed to the function as the link type.
There has been a similar previous issue #1604 which was fixed by converting the IssueLinkType to a string when calling the create_issue_link function using positional arguments. In this case, the create_issue_link function displays a warning and figures out the correct IssueLinkType on its own.
If an IssueLinkType is handed to create_issue_link using named arguments, the automatic conversion of the arguments is skipped (as it was added in #1604). The warning in create_issue_link is not displayed as the provided link type is found in the list of valid link types. In the next step, the IssueLinkType is however passed directly to the post function and thus creates a TypeError: Object of type IssueLinkType is not JSON serializable
Is there an existing issue for this?
Jira Instance type
Jira Server or Data Center (Self-hosted)
Jira instance version
9.4.15
jira-python version
3.6.0
Python Interpreter version
3.11
Which operating systems have you used?
Reproduction steps
Stack trace
Expected behaviour
In the create_issue_link function the type of the variable "type" needs to be checked before creating the data Dictionary. If it is of type IssueLinkType, the data Dictionary needs to be handed the name of the link type instead of the IssueLinkType object, e.g.:
Additional Context
No response
The text was updated successfully, but these errors were encountered: