Allowing create sub-task only for a specific issue type
Hi. I would like knowing how to manipulate with sub-task creation depending upon the parent issue type. For instance, I've got two issues created with the Bug and Task issue types respectively. I want to allow sub-task creation only for the issues of the Task type and forbid to create sub-tasks for the issues of the Bug type. Could, plz, help me?
Comments (11)
-
repo owner -
repo owner Other useful boolean expressions for validations of the same kind:
1. Avoid any type of subtask creation only to parent issue types "Bug" and "Enhancement":
%{00041} = null IMPLIES %{00040} not in ["Bug", "Enhancement"]
being %{00041} field code for field Parent's issue key
an equivalent expression without using connective IMPLIES and operator NOT IN:
%{00041} != null OR %{00040} != "Bug" AND %{00040} != "Enhancement"
2. Avoid "Sub-task" type creation only to parent issue types "Bug" and "Enhancement":
%{00014} = "Sub-task" IMPLIES %{00040} not in ["Bug", "Enhancement"]
or an equivalent expression without using connective IMPLIES and operator NOT IN:
%{00041} != "Sub-task" OR %{00040} != "Bug" AND %{00040} != "Enhancement"
3. Limit "Sub-task" type creation only to parent issue type "Task", and "Agile Sub-task" type creation only to parent issue types "Story" and "Epic":
(%{00014} = "Sub-task" IMPLIES %{00040} in ["Task"]) AND (%{00014} = "Agile Sub-task" IMPLIES %{00040} in ["Story", "Epic"])
or an equivalent expression without using connective IMPLIES and operator IN:
(%{00014} != "Sub-task" OR %{00040} = "Task") AND (%{00014} != "Agile Sub-task" OR %{00040} = "Epic" OR %{00040} = "Story")
-
repo owner Another issue with some relation to this one:
#53 -
repo owner - changed status to resolved
I close the issue. Please, reopen it if provided solution doesn't work for you.
-
Hi, How are you getting the subtask issue code and the parent issue code? Do you mean this is the id you are getting for the issuetype from the issue type table from the DB? Thank you.
-
repo owner Hi Pradyot,
%{00014} and %{00040} are codes (i.e., IDs) that JIRA Workflow Toolbox use for representing virtual fields. These virtual fields are implemented by the plugin, and can be used in any boolean expression.
In particular:
- %{00014} is field code for "Issue type", and contains the name of the issue type of current issue.
- %{00040} is field code for "Parent's issue type", and contains the name of the issue type of the parent of current issue.
As those two virtual fields return names of issue types, you should use literal strings with names of issue types for doing the comparisons.
In the examples above "Sub-task", "Task", "Agile Sub-task", "Epic" and "Story" are names of issue types.
In case you rename your issue types, you should also edit the boolean expressions, otherwise they will not work correctly.
Please, let me know if you keep having doubts.
Fidel
-
Hi Fidel,
Thanks for such quick reply. Still I don't get you. I use Jira Version 6.3 . Will %{00014} and %{00040} ID same for me too? I don't see any workflow Toolbox in my Jira. When I try to add the Validators at 'Create' transition of sub task type issue type workflow I see the screen (Please check the attached screen shot).
Your reply is greatly appreciated.
Thank you, Pradyot
-
repo owner Hi Pradyot,
All the examples in this issue use "Boolean validator with math, date-time or text-string terms" which a feature of JIRA Workflow Toolbox. This is a paid add-on for JIRA.
You can get a 1 month trial license clicking on "Try it free" at Atlassian's Marketplace add-on listing.
I engage you to try it. You will get a very powerful tool for doing almost anything you may need in your workflows.
-
Hi Fidel,
But, without having that plug in, I see the option of add the Boolean Expression (if you check the second screen shot in my prev comment). Then in the first screen shot you can see, where we can add the boolean expression.
Isn't it the same thing to achieve the goal?
Thank you, Pradyot
-
repo owner Pradyot,
I think that feature is provided by Workflow Enhancer plugin, which uses another syntax, and is much less powerful than JIRA Workflow Toolbox.
I can't tell you whether you can implement this use case with that plugin or not. You should contact its vendor for more details.
Regards,
Fidel
-
How to do it, if instead of Sub-Task, we need to prevent the creation of IssueType X under Epic ?
- Log in to comment
Hi,
I suppose that you have one issue task called "Sub-task" and you want to restrict its creation only to "Task" parent issue types. In that case you have to add validator Boolean condition with math, date-time or text-string terms to transition "Create Issue" of the workflow used by "Sub-task", with the following configuration:
Notice that:
Once configured, transition Create Issue will look like this: