Skip to content

Instantly share code, notes, and snippets.

@aheusingfeld
Created February 2, 2012 12:38
Show Gist options
  • Save aheusingfeld/1723281 to your computer and use it in GitHub Desktop.
Save aheusingfeld/1723281 to your computer and use it in GitHub Desktop.
Default Comment Security Level in Atlassian JIRA
<script language="JavaScript">
<!--
jQuery.noConflict();
var defaultRoleName = "role:10030";
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; });
//-->
</script>
<style>
.alertHeader{display:none;}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment