I have a script that is supposed to add a comment after updating the groups of a user:
Example, Calling the function:
jira_comment(jira, jira_issue, "This user has been added to jira groups: {0} by slack user: {1}".format(jira_groups, slack_username), True)
Function:
if internal_flag:
resp = jira_object.add_comment(
issue=issue,
body=comment,
visibility=None,
is_internal=True
)
else:
resp = jira_object.add_comment(
issue=issue,
body=comment,
visibility=None,
is_internal=False
)
I expected the comment to be "Restricted to Service Desk Team" but it fails to do so and the comment is visible for any user. Any help?
Вот примеры добавления внутреннего и публичного комментариев.
"""Запрос на добавление комментария в задаче"""
issue = jira.issue('SD-503')
comment = jira.add_comment(issue, 'Внутренний комментарий', visibility={'key': 'sd.public.comment'},
is_internal=True)
"""Добавление внутреннего комментария в задаче"""
issue = jira.issue('SD-503')
comment = jira.add_comment(issue, 'Публичный комментарий')
"""Добавление публичного комментария в задаче"""
Hi, Gonchik
I am using jira-python module to generate the json. I took a quick look and it looks like they just take in the arguments from the "add_comment()" function and form a dictionary then json.dumps() before making a requests.
I am using the function and passing in True for the variable: "is_internal" when calling it.
Here is the source code for the function:
https://jira.readthedocs.io/en/master/_modules/jira/client.html#JIRA.add_comment
Thanks,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Am having the same issue. Were you able to get this working and add comment restricted to team members?
Thanks
Arpi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
May I know you function generate the correct json ?
like this
{"body":comment, "properties":[{"key":"sd.public.comment","value":{"internal":True}},]}
Also, I will be happy if you create Pull Request into this repo this https://github.com/AstroMatt/atlassian-python-api
Thanks
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.