Notify watchers of parent when subtask is created in it.
Hi Fidel I need your help on how to setup this with your plugin. Parent issue watchers needs notification when new defect sub task created for the parent.
JIRA v 6.3.12 thanks for your help and support. Raj
Comments (14)
-
repo owner -
reporter Fidel 1.There are 10 statuses for parent issue. 2.parent can be in 4 or 5 statuses, when sub tasks are created.
-
repo owner A very simple solution would be to add parent's watchers also as watchers of its subtasks.
To implement this solution you simply have to add post-function "Copy a parsed text to a field" to "Create Issue" transition in subtasks's workflow using the following configuration:
Note that:
- %{00134} is field code for "Parent's watchers".
Once configured, transition "Create Issue" in subtask's workflow will look like this:
This solution also works if parent issue and subtasks share the same workflow.
There is also a more complicated solution that only notifies subtasks creation. That solution implies creation of several hidden reflexive transitions in parent's workflow.
If you want to consider the more complicated solution, I will explain it in detail.
-
reporter Fidel Thanks for simple solution for this, but all those watchers will get updates on subtasks also. Can it work for clone and copied issues also? i use listener script for clone and copy, in that i want to use above simple solution to get watchers from original issue. Can you please send me other option also. Thanks much. Raj
-
repo owner Hi Raj,
I explain you, step by step, how to implement a notification of subtasks creation to parent's watchers:
1) You have to add a reflexive transition called "Remove Parent Watchers" to first status (i.e., to the destination status of "Create Issue" transition) in subtask's workflow. A reflexive transition is a transition with a same status as origin and destination. It doesn't matter whether you share the same workflow for parent issues and subtasks. Once the reflexive transition has been added, your workflow will look similar to this:
2) Add condition "Transition is triggered by JIRA Workflow Toolbox post-function" to transition "Remove Parent Watchers". This condition will hide the transition to JIRA users, leaving it available only to workflow post-functions:
3) Add post-function "Add or remove watchers" to transition "Remove Parent Watchers" using the following configuration:
Once configured, transition "Remove Parent Watchers" will look like this:
4) Add post-function "Add or remove watchers" to transition "Create Issue" using the following configuration:
5) Add post-function "Copy a parsed text to a field" to transition "Create Issue" using the following configuration:
Once configured, transition "Create Issue" will look like this:
This solution adds temporarily parent issue's watchers to new subtask, and automatically remove them once they have been notified.
-
reporter Fidel Thank you very much, appreciate your support.
-
repo owner - changed status to resolved
-
reporter Hi Fidel Can this work for clone and copied issues also? I am using Jamie's script listener for clone and copy when status changes, in that i want to user your post function to get watchers from original issue. I added post function in create issue. I tried your post functions ( "text parsed in basic mode" and "Add watchers users in field") but still i am not getting watchers copied from original issue to cloned issue. Appreciate your help.
-
reporter - changed status to open
-
repo owner Hi Raj,
Do you mean "Clones an issue and links." listener of "Script Runner"?
-
reporter Yes.
Thanks & regards Raju Adluru
-
repo owner Raj, I have tried some listeners and it seems to work correctly. Can you please attach a screenshot with your listener's configuration?
Which version of Script Runner are you using?
-
repo owner Any updates, Raj?
-
repo owner - changed status to resolved
- Log in to comment
Hi Raj,
A pair of questions: