Hi All,
This is related to the post Set default comment visibility.
The solution does not work for Jira 7.2.9.
It looks like there is some issue with the vm or config or lookup
when we change default to a project role there is a rendering issue.
The change is
#if ($commentLevel) #set ($selectedCommentLevel = $commentLevel) #else #if (!$comment && $defaultLevelEnabled) #set ($selectedCommentLevel = "role:10000") #else #set ($selectedCommentLevel = "") #end #end
in the file system-comment-field-edit.vm
Any help is appreciated!
Thanks,
Parashar
Hi Parshar,
There is a Suggestion at JRASERVER-9091. Please vote on that Suggestion and add any use cases so we can gain some traction into getting this added into JIRA.
Cheeers,
Branden
Hi,
This is working perfeclty for us in 7.4.3.
But I have still an issue...
If I add a 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 one I used.
Is there a way to avoid this and always use the default 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.
Hi Marius,
I don't think that is possible as the value is chosen based on the user's last choice.
The default is only used if there is no last used data for the user.
Hope this helps.
-Parashar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Parashar,
thanks for the answer.
I did it now with a banner script.
I used this before, but with the update it did not work for comment within transitions... so when I change the config file system-comment-field-edit.vm and global.vm and use the script everything works perfetly:
Default in all commentfields (inclusive transitions) is "Internal" and the system ist not using the last used level anymore.
Banner Script if someone is interested:
<script language="JavaScript">
var defaultRoleName = "role:10020";
var customRoleSelected = false;
function changeCommentLevel()
{
if (customRoleSelected) return;
var commentLevelSelect = jQuery('.security-level select#commentLevel option[value=\'' + defaultRoleName + '\']');
if (commentLevelSelect)
{
var labelText = commentLevelSelect.first().text();
jQuery("select#commentLevel").val(defaultRoleName);
jQuery("#commentLevel-multi-select a.drop span.icon").removeClass("icon-unlocked").addClass("icon-locked");
var htmlEscapedLabel = AJS.$("<div/>").text(labelText).html();
jQuery(".security-level span.current-level").html(AJS.format(AJS.params.securityLevelViewableRestrictedTo, htmlEscapedLabel));
}
}
jQuery('#comment').live('focus', changeCommentLevel);
jQuery('#commentLevel-suggestions').live('click', function(){ customRoleSelected = true; });
jQuery('#issue-comment-add-cancel').live('click', function(){ customRoleSelected = false; })
jQuery('#issue-comment-add-submit').live('click', function(){ customRoleSelected = false; })
</script>
Cheers,
Marius
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 Martin,
Please vote on JRASERVER-9091 as well so we can add impact to this to get the feature implemented in JIRA.
Cheers,
Branden
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 Martin,
We worked around the rendering issue by updating global.vm where we replaced the line
#set($currentSelection = "$i18n.getText('security.level.restricted.to', $
{textutils.htmlEncode($level.name)}
)")
with
#set($currentSelection = "Restricted to <span class='redText'>Users</span>")
with this we do not see the rendering issue but this restricts the internationalization of the text displayed meaning any user irrespective of their language preference they see the text "Restricted to Users".
The change in system-comment-field-edit.vm would still be needed and global.vm change is only to fix the Text displayed in the browser UI.
Hope this helps.
-Parashar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Parashar,
Thanks so much for the reply.
I did in a similar way. You are right the issue is somehow related to $18n function here.
But instead of giving a fixed value, I set like this " Restricted to <span class='redText'>${textutils.htmlEncode($level.name)}</span>"
Regards,
-M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+1
Yeah, i did not think about that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.