Last active
January 11, 2019 13:49
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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