Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Default value for "Comment Viewable By"

If you want to set default value for "Comment Viewable By" globally, here is steps : 

[ Default Group ]

1. Decide the group, e.g. jira-developers

2. Replace following code in the file atlassian-jira/WEB-INF/classes/templates/plugin/comment/system-comment-field-edit.vm


#if (!$comment && $defaultLevelEnabled)
#set ($selectedCommentLevel = "default")
#foreach ($level in $groupLevels)
#if ($level == 'jira-developers')
#set ($selectedCommentLevel = "group:jira-developers")
#end
#end
#else
#set ($selectedCommentLevel = "")
#end

instead of 

#if (!$comment && $defaultLevelEnabled)
#set ($selectedCommentLevel = "default")
#else
#set ($selectedCommentLevel = "")
#end

3. Replace following code in the file atlassian-jira/WEB-INF/classes/templates/jira/global.vm

#if ($isRolePresent)
#foreach ($level in $roleLevels)
#if($level.id && $selected == "role:${level.id.toString()}")
#set($currentSelection = "$i18n.getText('viewissue.comment.visibleby') <span class=redText>$level.name</span>")
#set($locked = true)
#end
#end
#end
#if ($isGroupPresent)
#foreach ($level in $groupLevels)
#if($level && $selected == "group:${level}")
#set($currentSelection = "$i18n.getText('viewissue.comment.visibleby') <span class=redText>$level</span>")
#set($locked = true)
#end
#end
#end

instead of

#if ($isRolePresent)
#foreach ($level in $roleLevels)
#if($level.id && $selected == "role:${level.id.toString()}")
#set($currentSelection = "$i18n.getText('security.level.restricted.to', ${textutils.htmlEncode($level.name)})")
#set($locked = true)
#end
#end
#end
#if ($isGroupPresent)
#foreach ($level in $groupLevels)
#if($level && $selected == "group:${level}")
#set($currentSelection = "$i18n.getText('security.level.restricted.to', ${textutils.htmlEncode($level)})")
#set($locked = true)
#end
#end
#end

4. Restart your JIRA application

[ Default Role ]

1. find project role id in [JIRA Administration] -> [System] -> [Project roles], e.g. Developers is 10001

2. Replace following code in the file atlassian-jira/WEB-INF/classes/templates/plugin/comment/system-comment-field-edit.vm


#if (!$comment && $defaultLevelEnabled)
#set ($selectedCommentLevel = "default")
#foreach ($level in $roleLevels)
#if ($level.id == 10001)
#set ($selectedCommentLevel = "role:10001")
#end
#end
#else
#set ($selectedCommentLevel = "")
#end

instead of 

#if (!$comment && $defaultLevelEnabled)
#set ($selectedCommentLevel = "default")
#else
#set ($selectedCommentLevel = "")
#end

3. Replace following code in the file atlassian-jira/WEB-INF/classes/templates/jira/global.vm

#if ($isRolePresent)
#foreach ($level in $roleLevels)
#if($level.id && $selected == "role:${level.id.toString()}")
#set($currentSelection = "$i18n.getText('viewissue.comment.visibleby') <span class=redText>$level.name</span>")
#set($locked = true)
#end
#end
#end
#if ($isGroupPresent)
#foreach ($level in $groupLevels)
#if($level && $selected == "group:${level}")
#set($currentSelection = "$i18n.getText('viewissue.comment.visibleby') <span class=redText>$level</span>")
#set($locked = true)
#end
#end
#end

instead of

#if ($isRolePresent)
#foreach ($level in $roleLevels)
#if($level.id && $selected == "role:${level.id.toString()}")
#set($currentSelection = "$i18n.getText('security.level.restricted.to', ${textutils.htmlEncode($level.name)})")
#set($locked = true)
#end
#end
#end
#if ($isGroupPresent)
#foreach ($level in $groupLevels)
#if($level && $selected == "group:${level}")
#set($currentSelection = "$i18n.getText('security.level.restricted.to', ${textutils.htmlEncode($level)})")
#set($locked = true)
#end
#end
#end

4. Restart your JIRA application

 

Reference Robert Wolf's comment in https://jira.atlassian.com/browse/JRASERVER-9091 

0 comments

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you