Skip to content

Commit 779eba5

Browse files
authored
Fix add_comment_to_object sending data as query params instead of POST body (closes #1596) (#1627)
The Insight/Assets comment create endpoint expects JSON in the request body, not query string parameters. Using params= causes a 500 error.
1 parent ab3adf6 commit 779eba5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

atlassian/assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def add_comment_to_object(self, comment, object_id, role):
174174
raise NotImplementedError
175175
params = {"comment": comment, "objectId": object_id, "role": role}
176176
url = "rest/assets/1.0/comment/create"
177-
return self.post(url, params=params)
177+
return self.post(url, data=params)
178178

179179
def get_comment_of_object(self, object_id):
180180
"""

atlassian/insight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def add_comment_to_object(self, comment, object_id, role):
173173
raise NotImplementedError
174174
params = {"comment": comment, "objectId": object_id, "role": role}
175175
url = "rest/insight/1.0/comment/create"
176-
return self.post(url, params=params)
176+
return self.post(url, data=params)
177177

178178
def get_comment_of_object(self, object_id):
179179
"""

0 commit comments

Comments
 (0)