Skip to content

Possible to edit ServiceDesk comments? #498

@p-doyle

Description

@p-doyle

I'm interested in using this library in combination with a webhook to remove email signatures from comments made to a service desk ticket. When the webhook triggers after a comment is made, or when using this library's ServiceDesk.get_request_comment_by_id(), the body of the comment is returned as just a string, i.e. 'body': 'Hello,\n\nYeah, if you recall when you asked me on May 5, '

Although not part of the library, the Atlassian REST API has a PUT route for updating comments, /rest/api/3/issue/<issue-id>/comment/<comment-id>, however it seems to require a format like the below, with multiple sections depending on the content type and other formatting:

{"body":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello,"}]},{"type":"paragraph","content":[{"type":"text","text":"Yeah, if you recall when you asked me on May 5, "}},"properties":[{"key":"sd.public.comment","value":{"internal":True}}]}))

Is it possible to get the comments in a format like the above, so that they can be manipulated and then updated? Or, better yet, is there a way to update comments with just the body string?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions