Linked Issue closure condition

Issue #85 resolved
Ravi created an issue

Hi Fidel,

We have 2 type of stories and a sub-task.

“U Story” is the main one, and user should create “T Story” with the option “Linked Issues : depends on” and give “U Story” in the field.

After that some users should create “sub-tasks” from the “T Story”.

Now, user should only allowed to close “T Story” when all the sub-tasks are closed – its working fine and I have done through “Sub-Task Blocking Condition”

But when I am using “Condition on linked issues” to block “U Story” with the condition that all the linked “T Story” [with the Linked Issues : depends] should be closed before executing the next transitions – its not working

The reason behind this is we have configured “Linked Issues” field in “T Story” only, so that user can link it to “U Story” but not in “U Story” just to take a precaution that user should not fill any wrong value.

The condition is working absolutely fine when I add “Linked Issues” field in “U Story” but not without that.

Please help and show some way to achieve this scenario.

Thank you.

Comments (17)

  1. Fidel Castro Armario repo owner

    Hi Ravi,

    I would like to see the current configuration of "Condition on linked issues", in order to see exactly how you are using it. Could you please attach a screenshot of transition configuration screen? Only condition's tab is needed.

    Thanks.

  2. Ravi reporter

    Hi Fidel,

    Thanks for your prompt reply.

    Please find the attached screenshot of "User Story" transition's condition which is set to check whether all Tech stories are closed or not.

    Thank youcondition_screenshot.png

  3. Fidel Castro Armario repo owner

    Issue link type "depends" is quite peculiar, since it is read equally in both directions, unlike the rest of issue link types that comes with JIRA (e.g., "clones" and "is cloned by").

    Anyway, although it is read "depends" in both directions, the system internally makes the difference between both. I think that your problem has to do with that.

    Please try the following configuration change in the condition:

    • Check issue type link "depends" in both directions. Now you only have one direction checked.

    Optional, but I think that convenient changes are:

    • Check "Unselected issue link types are allowed": this will allow to link current issue (U-Story) using other issue link types, only requiring the status condition for issue link types "depends".
    • Check "Unselected issue types are allowed": this will allow to make "depends" links between current issue (U-Story) and issue types different from "T-Story", only requiring the status condition to issue links "depends" with issue types "T-Story".

    Please, close the issue if this changes solves your problem.

  4. Ravi reporter

    Hi Fidel,

    Thanks again for your prompt reply but its not working for me.

    Could it be a reason that i have not included "Linked Issues" field in "U-Story" and that's why its not allowing me to put any condition.

    The only condition which is working is when i unselect all the the things as shown in screenshot. Please could you advise

    condition_screenshot.png

    Also i am trying to copy assignee of Linked "U-Story" in "T-Story" watcher field but its not working - is it a same reason that i have not included "watcher" field in "U-Story". Please find the below screenshot of the post-function: watchers.png

    Thanks in advance.

  5. Fidel Castro Armario repo owner

    Hi Ravi,

    I have reproduced your configuration in JIRA 6.3.8 with JIRA Workflow Toolbox 2.1.22 and the condition is working as expected.

    The fact that you have configured or not a field to be seen in the screens of a certain issue type has nothing to do with this problem, since all fields can be read or written by post-functions, validators and conditions.

    Also the post-function for "Read fields from linked issues or subtasks" seems to be well configured, and "U-Story" should become the only watcher of "T-Story". By the way, I think its preferable to use virtual field "New watchers" instead of "Watchers", this way you respect current watchers of the issue.

    Sincerely, I have no idea of why it is not working for you. I think that it would be interesting to have a screen share by Skype, and this way I could see your system configuration and how it fails.

    I will be available today from 16:30 GMT to 18:00 GMT. My Skype user is fidel100r. Please confirm the time for the screen share.

  6. Fidel Castro Armario repo owner

    I will be available today from 22:00 GMT. Please, tell confirm an hour to have a screen share.

  7. Fidel Castro Armario repo owner

    Is it possible attach a PDF print of the configuration screen of the condition, i.e., the one you see when you edit the condition? I would like to see all available options (mainly statuses and issue links) and the ones you are checking.

    I also would like to see a PDF print for configuration of "Read fields from linked issues or subtasks" post-function?

    I tell you to use a PDF print, since the page is too long to fit in a unique screenshot.

    Also tell me the name of the transition and the workflow (the one of T-Story or of U-Story) where you are using the condition and the post-function.

  8. Fidel Castro Armario repo owner

    By the way, parameter "Minimum number of issues links required" should be 0 in order to allow the issue to be closed when there isn't any linked issue. Now you are requiring at least 1 issue link.

  9. Ravi reporter

    Hi Fidel,

    Thanks again for your replies.

    As you suggested, please find the attached screenshots :

    I've used "Updated Technical Story Details" transition and as mentioned in previous screenshots I have tried all the condition but its only working when i am giving null for everything. The reason why I set alteast 1 issue link should be there in transition is - we want user should create technical story and close it before executing this transition. I hope i set the right permission then, isn't it

    condition_on_linked_issue.png

    Regarding second issue, I've used "Finalized" transition in which i am trying to read the "assignee" field from linked issue type "depends on" and trying to put in "watchers"

    read_field_from_linked_issue.png

  10. Fidel Castro Armario repo owner

    Ravi,

    The only feasible explanation that I find for both failures is that issue types "T Story" and "U Story" belong to different projects.

    Can you please, try by selecting "any project" in configuration parameter "Linked issues or subtasks belong to:"?

    If the above explanation is not valid, please try implementing an equivalent condition using Boolean condition with math, date-time or text-string terms with the following configuration:

    conf-1.png

    The expression used is:

    filterByIssueType(linkedIssues("depends"), "Technical Story") IN filterByStatus(filterByIssueType(linkedIssues("depends"), "Technical Story"), "Closed") AND count(filterByIssueType(linkedIssues("depends"), "Technical Story")) > 1

  11. Fidel Castro Armario repo owner

    Ravi,

    I think that the explanation has something to do with what you said in your first post:

    The condition is working absolutely fine when I add “Linked Issues” field in “U Story” but not without that.

    Sorry, my bad for not having read it more carefully.

    I don't understand what you mean with: ...when I add “Linked Issues” field in “U Story”...

    I thought that you meant that you had removed the field "Linked Issues" from edit screen or some transition screens, but maybe you mean something different. Could you explain it to me, please?

  12. Ravi reporter

    Hi Fidel,

    Yes, you correctly understood the issue. I don't know whether you gonna believe or not but after setting up the exact condition as per the examples. I just tried with the jira system restart. (basically tried for application links :) ) and its working fine now :)

    I don't have any clue what was wrong in my configuration but i must say your plugin is working absolutely fine and has fulfilled most of the scenarios.

    Just one issue - still the assignee of linked issue is not coming in sub-task or linked issue. Do you think of anything.

    Thanks for all your help.

    Regards, Ravi

  13. Fidel Castro Armario repo owner

    Hi Ravi,

    I'm glad to see the condition is working, but it's very annoying not knowing exactly the cause of the failure.

    In relation to the usage of post-function "Read fields from linked issues or subtasks", I'm completely puzzled about it. I have reproduced your configuration and it's working nicely to me.

    Can you please attach a screenshot of post-function's tab of the transition where your are using "Read fields from linked issues or subtasks" post-function? I would like to see other post-functions you are using, and its execution order.

    I suggest you some things to try:

    • Try adding the post-function to another transition in your workflow.
    • Try reading another field (like Summary) in linked issues, and writing into another field (like Description or Environment) in current issue.
    • It may seem silly, but check whether you have a custom field called Watchers and you are selecting it instead of virtual field Watchers provided by JIRA Workflow Toolbox
    • Remove filtering restrictions, i.e., select also "depends" issue link type (or every issue link type if you wish), don't select any issue type and select any project.

    It's very strange, but I'm really lost about your case. Please, tell me which version of JIRA are you using, and if you have some plugin installed that you think may cause same kind of interaction with the workflows.

  14. Ravi reporter

    Hi Fidel,

    Thanks again for tips and technique.

    I tried with one custom field but due to unknown reasons it was not working. Then, i looked at one of the another field of your's workflow toolbox which do exactly the same stuff i want :) "Copy Value From Other Field Function for this transition".... I configured it and its working absolutely fine as i expected :)

    One last help - is there any way we can restricts user for not creating sub-tasks from the "Closed" stories. Thanks in advance

  15. Fidel Castro Armario repo owner

    Hi Ravi,

    Don't know which feature is that. I think you are using a feature that doesn't belong to JIRA Workflow Toolbox. Anyway, I'm glad to see you reached to do it.

    In relation to your last question: "How to restrict user for not creating sub-tasks from the "Closed" stories?", you will need to insert validator Boolean validator with math, date-time or text-string terms in transition "Create Issue" of workflow used by "Sub-task" with the following configuration:

    conf-1.png

    Expression used is: %{00040} = "User Story" IMPLIES %{00042} != "Closed"

    Notice that:

    • %{00040} is field code for Parent's issue type
    • %{00042} is field code for Parent's issue status

    Once configured, transition "Create Issue" of sub-task's workflow will look like this:

    conf-2.png

    Please, make each question in a different issue, in order to make it useful as reference information for other users of the plugin. Thanks.

  16. Ravi reporter

    Thanks a lot Fidel for all your help. Much appreciated.

    The condition is working absolutely fine.

    I must comment that your plugin has all the required features which anyone needs for the customization :)

  17. Log in to comment