Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.