I’m trying to find out why an internal Jira directory I create programmatically cannot be deleted. I can successfully create it using next code:
Set<OperationType> set = new HashSet<>( Arrays.asList(CREATE_USER, CREATE_GROUP, CREATE_ROLE, UPDATE_USER, UPDATE_GROUP, UPDATE_ROLE, UPDATE_USER_ATTRIBUTE, UPDATE_GROUP_ATTRIBUTE, UPDATE_ROLE_ATTRIBUTE, DELETE_USER, DELETE_GROUP, DELETE_ROLE)); DirectoryImpl directory = new DirectoryImpl("DIRECTORY_NAME", INTERNAL, InternalDirectory.class.getName()); directory.setAllowedOperations(set); Map<String, String> directoryAttributes = new HashMap<>(); directoryAttributes.put(DirectoryImpl.ATTRIBUTE_KEY_USER_ENCRYPTION_METHOD, "atlassian-security"); directoryAttributes.put(DirectoryImpl.ATTRIBUTE_KEY_USE_NESTED_GROUPS, "false"); directory.setAttributes(directoryAttributes); Directory newDirectory = crowdDirectoryService.addDirectory(directory);
The problem is that when I disable it in the Jira UI the button “Remove” does not appear. I was trying to see whether I’m missing any directory attributes but didn’t find anything in the Java API documentation. I know that it can be removed programmatically but would prefer to leave this activity to application itself.