auto-adding watchers

Issue #840 resolved
Scott McDonald created an issue

Hello:

Per new version of JIRA every time a users adds a ticket to the system they are automatically added as a watcher. For the parent ticket this functionality is good. However, for each individual sub-task auto created by the submitter it causes email fatigue and confusion on what sub-task is actually assigned to them. Is there a way that we can remove this functionality for sub-tasks besides turning off the system switch?

Thank you, Scott

Comments (47)

  1. Scott McDonald reporter

    Hi Fidel:

    Do I add this just once under post-function or is it needed for each ticket I am creating? For instance, under one of the workflow transitions, I'm creating up to 5 subtasks.

    Thank you, Scott

  2. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    The described post-function should be added in transition Create Issue in sub-task's workflow.

    If the same workflow is being used for normal issues and sub-tasks, then you should use the following boolean expression in parameter conditional execution:

    %{00041} != null
    

    where %{00041} is field code for Parent's issue key.

  3. Scott McDonald reporter

    Hi Fidel,

    I have tried every variation of that script and it's still adding the reporter as a watcher on the sub-tasks being created (on create/same workflow for parent and sub-tasks being created).

    I've used the watcher (multi-user field). I've used the watcher (watcher field) and have added/removed the conditional execution as well.

    Regards, Scott

  4. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    In your case, you should use boolean expression at conditional execution parameter, since you are sharing the same workflow for parent and sub-tasks.

    Please, attach a screenshot with post-function's tab of transition Create Issue. I want to see all the post-functions you are executing and their configurations.

  5. Scott McDonald reporter

    Hello. Apologies ahead of time but I am going to add about 10 screenshots since there are about 17 functions happening on create.

    Screen Shot 2017-10-11 at 2.05.05 PM.pngScreen Shot 2017-10-11 at 2.04.58 PM.pngScreen Shot 2017-10-11 at 2.04.47 PM.pngScreen Shot 2017-10-11 at 2.04.36 PM.pngScreen Shot 2017-10-11 at 2.04.20 PM.pngScreen Shot 2017-10-11 at 2.04.20 PM.pngScreen Shot 2017-10-11 at 2.04.05 PM.pngScreen Shot 2017-10-11 at 2.03.48 PM.pngScreen Shot 2017-10-11 at 2.03.34 PM.png

  6. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    It seems that JIRA adds the reporter as watcher with some delay after issue creation, for this reason it doesn't work my solution.

    I have this alternative solution, more complex, but it works:

    1) Add "Copy a parsed text to a field" post-function to transition "Create Issue" with the following configuration:

    Captura de pantalla 2017-10-20 a las 15.03.22.png

    2) Create a reflexive transition called "Initialize Issue" in first status of the workflow (in my case Open). Reflexive transitions has the same status as origin and destination.

    3) Add condition "Transition is triggered by JIRA Workflow Toolbox post-function" to transition "Initialize Issue", so that we will be hiding the transition to human users.

    4) Add post-function "Copy a parsed text to a field" to transition "Initialize Issue" with the following configuration:

    Captura de pantalla 2017-10-20 a las 15.00.41.png

    With this solution the reporter is removed as watcher with some delay, and you will have to refresh your browser after sub-task creation in order to see that the watcher was removed.

  7. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    A reflexive transition is a transition which has the same status as origin and destination. I show you how to do it in the following screenshot:

    Captura de pantalla 2017-10-25 a las 18.37.37.png

  8. Scott McDonald reporter

    Hi @fcarmario

    I can't get it to remove the watcher. Here are screenshots of my workflow. The second screen shot is in a post-function at create.

    Screen Shot 2017-10-25 at 2.53.53 PM.png Screen Shot 2017-10-25 at 2.54.09 PM.png Screen Shot 2017-10-25 at 2.54.23 PM.png Screen Shot 2017-10-25 at 2.54.29 PM.png

  9. Fidel Castro Armario repo owner

    Can you, please, show the whole post-functionˋs tab of your Create Issue transition? I want to see all the post-function's you are executing and their execution order.

  10. Scott McDonald reporter

    Here's from the reflexive transition post-function Screen Shot 2017-10-26 at 7.52.07 AM.png

    This screenshot is from the Create function (i blacked out names) Screen Shot 2017-10-26 at 7.54.13 AM.png

  11. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    You configuration seems to be ok. I have used a configuration similar to this on JIRA 7.4.3 with JWT 2.2.42 and it's working perfectly.

    Please, let's try the following change in order to find out whether the reflexive transition (i.e., "Initialize Issue") is being executed:

    Add pot-function "Copy a parsed text to a field" to transition "Initialize Issue" with the following configuration:

    • Target field: New comment
    • Parsing mode: basic
    • Text to be parsed: Transition 'Initialize Issue' executed successfully at %{00057}.

    Now try creating a normal issue and a sub-task. In the second case, you should get automatically a comment created. You may need to refresh your browser just after issue creating in order to see the new comment.

    Please, let me know the result of this test.

    BTW, which version of JIRA and JWT are you using?

  12. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    The solution I have provided only works with sub-tasks, i.e., auto-transition of "Initialize Issue" transition will only be automatically carried out in case of sub-tasks.

    In any case, try clearing parameter Conditional execution, and let me know whether the comment is automatically created.

  13. Scott McDonald reporter
    • changed status to open

    Hi @fcarmario

    I need to reopen this. Since I am having sub-tasks created via post-function(s), I will need the reporter to be removed from those as well. The functionality is working for the parent tickets but not for the auto-generated sub-tasks. Please assist.

    Scott

  14. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Can you, please, attach a screenshot of the configuration of the post-function's you are using for creating the sub-tasks?

  15. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Try editing post-function "Copy a parsed text to a field" in transition "Create Issue" with the following configuration:

    • Target field: Execute transition (delayed execution)
    • Parsing mode: basic
    • Text to be parsed...: Initialize Issue : {delay=2500}
    • Conditional execution: same boolean expression as your are currently using

    With this modification, the auto-transition to remove the watcher will be executed 2,5 seconds after issue creation.

  16. Scott McDonald reporter

    Hi -

    If I add a sub-task manually after the parent ticket has been created (parent ticket is in open status), it's still adding the reporter as a watcher. I'm attaching my functionality from both the Create stage and reflexive transition (Initialize issue).

    Thank you,

    Scott Reflexive transition: Screen Shot 2017-11-01 at 8.42.38 AM.png

    On Create: Screen Shot 2017-11-01 at 8.44.05 AM.png

  17. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Is the automatic comment being created when you create a sub-task?

    Does the configuration you show in the screenshots correspond to parent's workflow or sub-task's workflow?

  18. Scott McDonald reporter

    Hello:

    The comment is only happening on the parent ticket.

    That configuration is on the parents workflow. All the subtasks are happening on the parents workflow but there's no configuration like that on the sub-tasks workflow. I don't have reflexive transitions happening on sub-task workflow. Screen Shot 2017-11-01 at 9.36.00 AM.png

    Scott

  19. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    I mistakenly assumed that you were using the same workflow for parent issues and sub-tasks. The configuration I provided to you is to be implemented only in sub-task's workflow, not in parten's workflow.

  20. Scott McDonald reporter

    Hi @fcarmario

    I've added this logic to the sub-tasks and it removes the reporter from the watcher list! Nice. One thing I did notice, however, was in order for it to successfully work, the logic that automatically adds a comment needs to be in the post-function as well. Is that necessary? It's causing unnecessary notifications being sent out.

    Scott

  21. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    No, you don't need the post-function for comments. It was only for debug reasons.

  22. Scott McDonald reporter

    That's what I thought so I removed the logic, however when I manually added a sub-task, it adds the reporter as a watcher.

    Scott

  23. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Did it work correctly when the post-function for adding a comment automatically was present in transition "Initialize Issue"?

    If you try adding the post-function for creating a comment, does it work correctly again?

  24. Scott McDonald reporter

    Hi,

    Yes, when the post-function for adding a comment is in place, the reporter is removed from the sub-task, however, once I delete the post function to add a comment, the reporter is added as a watcher.

  25. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    That behavior is very strange. Please try the following changes:

    1. Move post-function "Copy a parsed text to a field" in transition "Initialize Issue" at first position in execution order.
    2. Extend the delay in 1 second using : {delay=3500} suffix.

    Let me know whether any of these changes solve the problem.

  26. Scott McDonald reporter

    Hello -

    The post function where I have reporter being added to the watcher field - does the negative sign in front of the code supposed to remove the watcher? Does any of that code need to be there?

    Thank you.

    Screen Shot 2017-11-03 at 4.32.20 PM.png

  27. Scott McDonald reporter

    Hello -

    I have some interesting things going on now...it's adding the hiring manager (custom field) as a watcher now in all the subtasks, even though I don't have that specified anywhere but when the parent ticket is being created. What do you need from me to troubleshoot? Can I send you the xml?

    Scott

  28. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Can we have a screen-share through Skype tomorrow? I will be available from 16:30 UTC to 18:00 UTC.

    Please, propose a time to arrange the meeting.

  29. Scott McDonald reporter

    Any way we can do this today? I am available today from 16:30 UTC to 18:00 UTC or tomorrow from 16:30 UTC to 18:00 UTC.

    Scott

  30. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Sorry, today is not possible. You can send to me the XML exports of the workflows of subtasks and parent issue, but I think I need a screen-share to see the problem in direct.

  31. Scott McDonald reporter

    Hi @fcarmario ,

    I will email them to support. In the meantime, once you review them let me know so we can get on a call to review.

    Scott

  32. Scott McDonald reporter

    Now I'm being added to all the subtasks. If I set the reporter as a user that's not in the system, I automatically get added as a watcher to all the subtasks. What would cause that?

    Basically what I need done is to make sure the reporter doesn't get notified on each subtask created. The user will submit a parent ticket, which creates up to 30 subtasks automatically and is being set as the reporter on all 30, plus the parent ticket. This is causing a lot of emails since all the sub-tasks are for someone other than her (the tasks are for IT, Accounting, etc). She is from HR and just the submitter. I know I can set the reporter to a specific name but how can I set it where the submitter doesn't actually get added as the reporter, or better yet, get notified of every change on those ticket since she is the reporter. I also don't want that user added as a watcher, to suppress notifications there as well.

  33. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Can we arrange a meeting at 17:00 UTC? My skype user if fidel100r.

  34. Scott McDonald reporter

    Hi @fcarmario

    Thanks again for your help today. One more question before I close out this task. Is there a way to prevent the reporter from getting notified on issue create (not in notifications)?

    Thank you,

    Scott

  35. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    Sorry, I'm afraid it's not possible, since we are not able to remove the watcher until the issue is already created.

  36. Fidel Castro Armario repo owner

    Hi @scottjmcdonald,

    I close the issue. Please, reopen it if you need additional support on it.

  37. Log in to comment