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 @Scott McDonald,

    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 @Scott McDonald,

    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. Fidel Castro Armario repo owner

    Hi @Scott McDonald,

    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.

  6. Fidel Castro Armario repo owner

    Hi @Scott McDonald,

    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?

  7. Fidel Castro Armario repo owner

    Hi @Scott McDonald,

    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.

  8. Scott McDonald reporter
    • changed status to open

    Hi @Fidel Castro Armario

    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

  9. Fidel Castro Armario repo owner

    Hi @Scott McDonald,

    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.

  10. 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

  11. 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

  12. Scott McDonald reporter

    Hi @Fidel Castro Armario

    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

  13. 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.

  14. 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

  15. 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

  16. 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.

  17. Log in to comment