Hi,
my default security level restricts the access to internal users and a "Group Custom Field Value". This works fine.
When I create a subtask by hand, it inherits the Issue Security Level of its parent.
But when I create a subtask in my code on an issue event, the subtask doesn't inherit the Issue Security Level of its parent.
My EventListener calls the following method:
private void createDevelopmentSubtask(Issue issue, User initiator) throws CreateException { MutableIssue mutableSubtask = issueFactory.getIssue(); mutableSubtask.setProjectObject(issue.getProjectObject()); mutableSubtask.setIssueTypeId(DEVELOPMENT_SUBTASK_ID); mutableSubtask.setParentId(issue.getId()); mutableSubtask.setSummary("Development-Subtask: " + issue.getSummary()); mutableSubtask.setReporter(initiator); mutableSubtask.setPriorityObject(issue.getPriorityObject()); mutableSubtask.setAffectedVersions(issue.getAffectedVersions()); mutableSubtask.setFixVersions(issue.getFixVersions()); mutableSubtask.setComponentObjects(issue.getComponentObjects()); mutableSubtask.setLabels(issue.getLabels()); Issue subTask = issueManager.createIssueObject(initiator, mutableSubtask); subTaskManager.createSubTaskIssueLink(issue, subTask, initiator); log.info("Created Subtask: " + subTask.getSummary()); }
The User "initiator" has the right to set security levels. I also tried a reindex before and after the "createSubTaskIssueLink()" without success.
Any ideas?
Community moderators have prevented the ability to post new answers.
I could get it work with
mutableSubtask.setSecurityLevelId(issue.getSecurityLevelId());
It seems, subtasks just inherit the security level if you create them via the Jira UI. So when you create them via code, you have to set the securityLevelId as shown above.
If you don't set the securityLevelId, the subtask doesn't inherit the level until you update the level of the parent task.
Subtasks automatically inherit security level of the parent issue , there is no field such as security level for subtasks .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.