atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.37k stars 664 forks source link

[BitBucket] new task creation in Pull Request loses newlines symbols #785

Open manefix opened 3 years ago

manefix commented 3 years ago

New task creation via Rest Api in Pull Request loses newlines symbols url = 'https://servername:port/rest/api/latest/tasks'

    data = {
        "anchor": {
            "id": id,
            "type": "COMMENT"
        },
        "text": "line1\n line2\n line3"
    }
    resp = post(url,
                headers=self.headers,
                data=json.dumps(data),
                auth=auth)

Expected result: task appears with keeping formatting symbols like \n \t \r Actual result: new tasks lost all formatting and posted with oneliner text :(

Spacetown commented 3 years ago

I checked the API and the task point is deprecated since version 7.2 it should be changed to comment with severity blocker. Maybe the text is interpreted as HTML which ignores the line breaks.

manefix commented 3 years ago

maybe, I used end point 'https://servername:port/rest/api/latest/tasks' or from atlassian python wheel add_task with the same endpoint so no success) what do you recommend how to fix it?

manefix commented 3 years ago

I have tried to send t comments end point the same as comment but adding fields status and severity and it worked, thank you @Spacetown

manefix commented 3 years ago

BTW tasks endpoint is still there in 7.7 version of BB at least