Hello!
I am trying to address a gap in the Jira architecture in that you cannot restrict sub-tasks given a parent issue type. See this very old request here - https://jira.atlassian.com/browse/JRA-7990
I am attemptoing to use JJUPIN Live Fields to accomplish this. We have used this to restrict issue types based on things like group membership or resolution (like here - http://confluence.kepler-rominfo.com/display/TR/Restricting+resolutions+based+on+issue+type). So my basic logic is as follows...identify the parent tasks that should not allow sub-tasks, identify the sub-task types to restrict and then if the parent task used should be restricted, do so via live fields function.
// array of parent issue types that should not allow subtasks string[] standAloneParentTypes = {"Idea", "Bug", "User Access Request"}; // array of the sub-task issue types to restrict string[] forbiddenTypes = {"UX Design Sub-task", "QA Sub-task", "Tech Design Sub-task"}; // If the parent issue type is one that cannot have sub-tasks, restrict options to not include them if (arrayFind(standAloneParentTypes, issueType) != -1) { lfRestrictSelectOptions("issueType", forbiddenTypes); }
This does not seem to work. I am pretty sure that I am not reading the issueType of the parent task from which a subtask is being created. Anyone know how I would go about doing this? I have an idea of adding a custom field like allowsSubtasks and set that post creation and then use it in this same scenario if I cannot get this to work.
Hi Joe,
Your syntax is worng. You should use parent.issueType instead of "<strong>issueType</strong>" in your if clause, like this:
if (arrayFind(standAloneParentTypes, parent.issueType) != -1) {
lfRestrictSelectOptions("issueType", forbiddenTypes);
}
if (arrayFind(standAloneParentTypes, parent.issueType) != -1 && arrayFind(forbiddenTypes, issueType) != -1) {
return false, "issueType", "You cannot select issue type '" + issueType + "'";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.