Preventing issue from being closed if has "is blocked by" issue linked

Hi,

I am trying to create a condition in my workflow that will not allow the issue to be closed if it has linked issues that block it and don't have the status Closed. The background is that I am using the plugin Structure to arrange my issues. Using the Sync feature when I structure my project it adds blocked links to the issues. So I want to make sure that a parent issue can't be closed unless the child issue is closed.

I have played around and checked the forums but am not having much luck with this.

I have attached a screen shot of my latest attempt.

Thanks,

Mike

5 answers

1 accepted

Hi Mike,

You have to check "Issue link types not selected are allowed" and "Issue types not selected are allowed". I add some screenshots using "Validation on linked issues" instead of the "Condition on linked issues", since both modules use the same configuration.

Regards,

Fidel Castro Armario.

Hi Fidel,

Thanks for the hint! Will try it post haste!

Mike

Hello Fidel,

I am using Jira 5.0.3. I am not able to see the above screen, when I try to add a new validation. How to get to that screen? where I can add " Validation on linked issues ".

When I try to add all i can see is the following features.

DateCompare

Field required

permission validator

script validator

user permission validator

window dates

Do i need a plugin for that ? if so what plugin is that.

Hi,

OK, that worked, I was also setting a condition and not a validator. Now it works as expected.

Thanks!

Mike

Hi Sridhar,

The plugin is JIRA Workflow Toolbox.

Regards,

Fidel.

Hi Fidel,

We have configured Preventing parent issue from being closed until child linked issue status is closed using "Jira Workflow Toolbox" plugin. It is working perfectly. Now we need to send email notification whenever a user want to close parent issue without closing child link issue. I.E - test1 is parent issue and test2 child issue. If anybody try to close test1 until closing test2 then a email notification should be generated like - "Linked issues must be closed before closing parent issues". Also please note I am not talking about subtasks. The issues are normal tasks but linked

Regards

Sumit Mitra

Hi Sumit,

JIRA Workflow Toolbox doesn't have any post-functions to send email notificacions.

Anyway, if you are using validator "Validation of linked issues" you are already showing the user a custom message informing him he should close child linked issues before closing parent issue. This is not the case for "Condition on linked issues", so I usually recommend to use validators for this kind of usage.

In your case, who do you want to send the email notificacition to?

Regards,

Fidel.

In our case the requirement is as below -

when somebody try to close parent issue without closing child link issue a mail notification should be send to certain jira group members.

Also "Validation of linked issues" is not working for "Start Progress" transition. We need to configure this for "start progress" transition. I.E - test1 is parent issue and test2 child issue. Noybody can start progress test1 until start progress test2. However this is working for "Stop Progress". Could you please suggest

You shouldn't have any problem to make it work on any transition of your workflow, even on "Create Issue" transition.

Please, attach a screenshot of the configuration you are trying in "Start Progress" transition, or send it to me by email to fcarmario@gmail.com.

Which issue link type are you using to set parent-child relationship between issues?

Please find the screenshot below. Also I have send the screenshot to your mail ID.

Do you want to set the restriction you described, only for issues linked with issue link type "has to be done after", or do you want to apply them also to issue link types "duplicates" and "depends"?

In first case, you have to uncheck issue link types "duplicates" and "depends". If you want to apply the the restriction to all three issue link types, keep them checked.

Have you thought that perhaps the child issues can be in more advanced statuses that "In Progress", i.e., it can be "Resolved", "Closed" or even "Reopened"?
If I'm not wrong you have to check also statuses "Resolved" and "Closed" and I think that even "Reopened" should be checked.

I want to apply for "has to be done after" , "duplicates" and "depends"? issue link type. Problem still persist after checking statuses like "Resolved" , "Closed" and "Reopened"

It should work. Which version of JIRA and the plugin are you using?

Can we have a screen share by Skype to try to find what is going on?

Jira version - 5.2.4.1 and Plufin Version - 2.1.15. I have send skype request to you. Please accept. I am also wondering why same configuration working for other transtions but not working only for start progress

Inward and outward are both directions for a same issue link type. For example, when you link two issues (A and B) using issue link type "duplicates / is duplicated by", if you look at the link from issue A you may see "A duplicates B" and when you look at the same issue link from B, you see "B is duplicated by A"

When configuring the validator, you can see that every issue link type has one check available at parameter "Inward issue link types" and another at parameter "Outward issue link types". If you need to configre the validator for all issue link types, you have to check only one of the directions for each issue link type. You can choose any of both directions available for each issue link type, but never both, since if you checked both directions for a same issue link type, you would be losing the sense of parent-child relationship, and the validator never would be satisfied for that particular issue link type.

For this reason, it doesn't make sense to configure the validator for issue link type "relates to", since both directions are equally named, making it a no-directional issue link type, and so there is not parent-child relationship.

Hi Fidel,

Thank you for your detail explanation. I have understand the logic. Thanks a ton

Regards

Sumit

Hi Fidel,

We have another requirement regarding this. when somebody try to close parent issue without closing child link issue a mail notification should be send to certain jira group members. Could you please inform whether this is possible or not? If possible then could you please provide us the procedure?

Regards

Sumit

Hi Sumit,

Sorry, JIRA Workflow Toolbox doesn't have any post-functions to send email notificacions. Anyway, you are trying to send a notificacion when a transition can't be executed due to a validator failure. Not even a post-function would solve your requirement, since the post-funcions won't be executed.

At this moment, the plugin can't fullfil this requirement.

Regards,

Fidel.

Hi Fidel,

Thank you very much for your reply. We understand

Regards

Sumit

Hi Tim,

I have documented a similar use case in detail: "Automatically move issue to "In Progress" status once all its blocking issues are in "Closed" or "Resolved" statuses"

Please, pay attention to:

  • Write the name of the issue status you want to auto-transition the issue to exactly as it is (e.g. "Open" and not "OPEN"). Since version 6.x JIRA UI presents the name of the statuses always in upper case. Next version of JIRA Workflow Toolbox (2.1.20) won't be case-sensitive for "Issue status".
  • Select virtual field "Issue status (delayed writing)" instead of "Issue status" as target field in post-function "Write field on linked issues or subtasks"

Regards,

Fidel

That did it, Thanks!

0 vote

Hi Mike,

Have you tried adding the Condition "Sub-Task Blocking Condition" with "Closed" status?

You should end up with the following condition on your transaction "All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed. ".

Hope this helps,

Marcus Silveira

Hi Marcus,

I tried this, but didn't work. I think it because I am using the Structure plugin and tasks that appear as sub-tasks are not technically sub-tasks.

Mike

Hi Fidel,

Thanks a ton. I had select "Open" status in "Allowed issue statuses", section. As per your suggestion since I want to require child issues to be "In Progress" or a more advanced status I have unselect "Open" status and it is working perfectly now. You are simply great. Thanks a ton.
Another question. Can we set this validation for all "issue link types" for Jira status. Actually some "issue link types" showing in "inward issue link types" and some showing in "outward issue link types". So I am confused which "issue link types" I need to choose from where. We need to set this validation for every "issue link types"
Regards
Sumit

I have a post function setup on the resolved transition to auto-transition blocked issues to unblocked/open when the blocking issue is resolved/closed. I am trying to add a validator that won't allow the blocked issue to transition to unblocked/open if it has multiple blocking issues and one of them is still open. The validator works when I go to the issue and click unblocked, I get the text I entered in the validator if there are still open blocking issues and I can get it unblocked if all blocking issues are closed/resolved but the post-function does not work. Is there an order that these fire in that is causing the issue here?

Example: Bug A is blocked by bug B & C. Bug C gets resolved, post-function should try to unblock/open bug A but validator should see that bug B is still open and stop it. (working) Once bug B is resolved and assuming bug C is still resolved then the post-function should fire and the validator should pass and bug A should transition to open. (not working)

Any ideas what is causing this to fail?

Figured it out, I was using the wrong script listener. Switched to the Fast-track transition listener and that is working great now.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published 2 hours ago in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

15 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you