atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

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

Open manefix opened this issue 4 years ago • 4 comments

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 :(

manefix avatar May 18 '21 20:05 manefix

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.

Spacetown avatar May 18 '21 20:05 Spacetown

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 avatar May 19 '21 09:05 manefix

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 avatar May 19 '21 13:05 manefix

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

manefix avatar May 19 '21 13:05 manefix