Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuikoaleksandr/1b1bd482ab2d132421b938c6c4841f82 to your computer and use it in GitHub Desktop.
Save chuikoaleksandr/1b1bd482ab2d132421b938c6c4841f82 to your computer and use it in GitHub Desktop.
Atlasteam, Jira, plugin JsIncluder. When to hide fields depending on the user group. For https://atlasteam.ru/?p=1925
(function ($) {
function hideField(fieldId) {
$('div.field-group:has(#customfield_' + fieldId + ')').hide()
}
function isUserInGroup(groupName) {
return JS_INCLUDER.params.userDetails.groupNames.indexOf(groupName) != -1
}
if (isUserInGroup('jira-users')) {
return
}
var fields = [10000, 10001]
fields.forEach(function (fieldId) {
hideField(fieldId)
})
})(AJS.$)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment