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 comment visibility in Jira 7.2X

Parashar Joshi Jun 30, 2017

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.


image.png

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

3 answers

1 accepted

0 votes
Answer accepted
Branden McElveen Atlassian Team Jul 03, 2017

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

0 votes
Martin Tang Sep 27, 2017

having the some issue. @Parashar Joshi have you gotten any update?

Best,

Ming

Branden McElveen Atlassian Team Sep 27, 2017

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

Martin Tang Sep 27, 2017

Yes, I did.

Cheers.

-M

Parashar Joshi Sep 28, 2017 • edited

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

Martin Tang Sep 28, 2017

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

Parashar Joshi Dec 06, 2017

+1
Yeah, i did not think about that.

0 votes
Marius Tiedtke Dec 06, 2017

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

Parashar Joshi Dec 06, 2017

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

Marius Tiedtke Dec 07, 2017

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

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Jira Software

Demo Den Ep. 5: Meet Jira Mobile

See how to use Jira on the go! Demo Den Episode 5 is here: meet Jira Mobile with  Jira  Product Manager Rayen Magpantay.  Demo Den is in our monthly series where a Jira PM demonstrates...

315 views 1 10
Join discussion

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