I have a couple Jira projects that it would be beneficial to set the default visibility on commenting to the developer project role. Ideally I'd like to be able to set this seperately for the current assignee (which I'd like to leave at default visibility) and the rest of the developers. Is there a ready way to do this?
Hi,
For modify default visibility comment I do this:
Edit file:
/[FOLDER OF JIRA]/atlassian-jira/WEB-INF/classes/templates/jira/issue/field/comment-edit.vm
This is original:
#if ($commentLevel)
#set ($selectedCommentLevel = $commentLevel)
#else
#set ($selectedCommentLevel = "")
#end
This my code modified:
#set ($selectedCommentLevel = "role:10100")
#if ($jiraUserUtils.getGroupNamesForUser($authcontext.getLoggedInUser().getName()).contains("client-users"))
#set ($selectedCommentLevel = "role:10101")
#end
This code set default visibility comment to role 'Developers' (where role number is 10100) and if user is in group 'client-user' in my JIRA, the default comment visibity is role 'Clients' (where number roles i 10101).
Thanks for help Daniel, works great.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this and it works, but it shows like the below
$i18n.getText('security.level.restricted.to', ${textutils.htmlEncode($level.name)})
instead of
Restricted to XXXXXXX
it just doesn't look clean.
Am I doing something wrong?
#if ($issue.project.key && $issue.project.key == "ABC")
#set ($selectedCommentLevel = "role:10200")
#else
#if ($commentLevel)
#set ($selectedCommentLevel = $commentLevel)
#else
#if (!$comment && $defaultLevelEnabled)
#set ($selectedCommentLevel = "default")
#else
#set ($selectedCommentLevel = "")
#end
#end
#end
Pretty much for project ABC, I want to default comments to the role 10200.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How is this working in cloud jira?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The change mentioned above is only for server and data center
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tim, there's a js workaround mentioned in this answer:
It's the same that it is mentioned in this issue:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i want to set restriction like
ex:
if A project is there means if they comment means only B Project Role person should see and no other user's should see that comment.
but we want other project roles comment visibility should be as same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks Daniel for your post.
This is working perfeclty for us in 7.4.3.
But I have still an issue...
If I add an comment with a different role and then want to add another comment, the default is not the one defined in the .vm file but the last used.
Is there a way to avoid this and always use the role from the file?
Thank you very much,
Marius
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
*comment-edit.vm* has been replaced by *system-comment-field-edit.vm* (atlassian-jira/WEB-INF/classes/templates/plugin/comment/system-comment-field-edit.vm).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could someone please turn this into an add-on for cloud so those users could benefit by it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please help.
I can't find comment-edit.vm in JIRA 6.4.5.
Thanks
Ganga S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I cannot find the file comment-edit.vm in JIRA 7.1.6.
Please help.
Thx
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.
Hi, I realise you have found your answer but for others looking for an answer where they don't have to edit files or want project level default then I have a paid plugin in the marketplace called comment security default (https://marketplace.atlassian.com/plugins/com.redmoon.jira.comment-security-default). This allows you to set a default globally or per project. You can also assign behaviour in case the permission is no longer available (you can force the user to choose a new permission). The default can be set for adding a comment, adding an attachment, logging work, linking issues and editing issues.
Thanks
Paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for help Daniel, works great.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Tim,
To answer your question "Is there a ready way to do this?"
The permissions available for comments are
1. Add comments
2. Edit all comments
3. Edit own comments
4. Delete all comments
5. Delete own comments
These permissions can be set in the permission scheme being used by your project.
For more info refer to https://confluence.atlassian.com/display/JIRA/Managing+Project+Permissions
There is a feature request you might be interested in voting for
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.