Send e-mail to the next sub-task assignee, if the subtask before goes in Status 'done'
I want to send a notification mail to the assignee of the next subtask, if the assignee is an other user in the next subtask. The condition for that is, the subtask of the subtask before should go in status done. For example
Subtask 1 User 1 Done Subtask 2 User 1 Done --> Notification mail to user 2 Subtask 3 User 2 To Do
Is that possible?
The second issue is to enable closing (status done) only a task, if all subtasks are in status 'done'. After the status done of the last subtask, the task assignee should get a notification mail.
By opening the subtask again, the task should go in status 'to do'.
I know, this are two questions. There are relations between of them.
Best regards
Seher
Comments (10)
-
repo owner -
repo owner ###USE CASE 2 - Enable closing (status Done) a Task only if all its Subtasks are in status Done###
Add "Boolean validator with math, date-time or text-string terms" validator to Close Issue transition in Task's workflow with the following boolean expression:
count(filterByStatus(subtasks(), "Done")) = count(subtasks())
-
repo owner ###USE CASE 3 - When last Subtask is closed (status Done), Task's assignee should get a notification by mail###
Add Send an email post-function to Close Issue transition of Subtask's workflow with the following configuration:
Parameter Conditional execution is:
count(filterByStatus(siblingSubtasks(), "Done")) = count(siblingSubtasks())
-
repo owner ###USE CASE 4 - When a Subtask is reopened, its Task should go in To Do status:###
Insert "Copy a parsed text to a field" post-function in Reopen Issue transition in subtask's workflow with the following configuration:
-
reporter Thank you,
I will write you after testing it.
Best regards,
Seher
-
reporter Hi Fidel,
nice it works. But can we define a condition for the subtasks? I want to set my subtask to status done, only if my subtask before is in status done. So I want to follow the order. At first subtask 1 then subtask 2 then 3 and so on. I'm now allowed to close subtask 4, before the first three are closed. This condition should exist for all my subtasks in sequence.
Thank you for your help.
Best regards,
Seher
-
repo owner ###USE CASE 5 - Prevent Subtasks from closing (status Done) while there are previous Subtasks not yet closed (status different from Done)###
Add "Boolean condition/validator with math, date-time or text-string terms" condition or validator to Close Issue transition in Subtask's workflow with the following boolean expression:
count(filterByPredicate(siblingSubtasks(), indexOf(^%{00015}, subtasks(%{00041})) < indexOf(%{00015}, subtasks(%{00041})) AND ^%{00016} != "Done")) = 0
Note that:
- %{00015} is field code for Issue key
- %{00041} is field code for Parent's issue key
- %{00016} is field code for Issue status
You can implement this restriction as a condition or as a validator. I recommend the second one, because you can show the uses a custom message explaining the cause that prevents him from closing the subtask.
-
reporter Hello Fidel,
thank you for all your help. It helps me reallly to understand the workflow and how much functionalities can be implemented with the workflow box.
Best regards,
Seher
-
repo owner You are welcome.
-
repo owner - changed status to resolved
- Log in to comment
Hi Seher,
All those use cases can be implemented using JIRA Workflow Toolbox.
###USE CASE 1 - Notification by Mail to the assignee of the Next Subtask:###
We have to insert the following two post-functions in Close Issue transition in subtask's workflow.
1) Use "Copy a parsed text to a field" post-function with the following configuration:
Text to be parsed is:
This post-function populates Ephemeral string 1 with the assignee of the next subtask, or null is current subtask is the last one.
Note that:
2) Use "Send an email" post-function with the following configuration:
Parameter conditional execution is:
Note that:
Once configured, Close Issue transition in subtask's workflow will look like this: