我正在尝试使用 jira-python 编辑 jira 中的评论,但找不到任何内容。
我知道add_comment
会添加评论,但我也想知道如何编辑
评论。
最佳答案
comment
是一个对象,类似于 issue
,因此您可以以相同的方式进行编辑,例如:
如果您知道 ID:
# '10234' represents the comment id:
comment_to_edit = jira.comment('JIRA-1200', '10234')
comment_to_edit.update(body='Edit the content to something new.')
或者,如果您在创建变量时已将注释分配给变量:
comment_to_edit = jira.add_comment('JIRA-1200', 'Change this content later')
comment_to_edit.update(body='New Content.')
如果您需要查找 ID,您可以通过以下方式获取问题中的评论列表:
list_of_comments = jira.comments('JIRA-1200')
更多信息可以在Docs中找到
关于python - 如何在 Jira(Python) 中编辑/更新评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46656962/