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

Mike Wells
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2012

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

6 answers

1 accepted

1 vote
Answer accepted
Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2012

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.

Mike Wells
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2012

Hi Fidel,

Thanks for the hint! Will try it post haste!

Mike

SRIDHAR September 24, 2012

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.

Mike Wells
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2012

Hi,

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

Thanks!

Mike

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2012

Hi Sridhar,

The plugin is JIRA Workflow Toolbox.

Regards,

Fidel.

Sys Admin April 28, 2014

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

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2014

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.

Sys Admin April 29, 2014

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

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2014

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?

Sys Admin April 29, 2014

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

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2014

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.
Sys Admin April 29, 2014

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"

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2014

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?

Sys Admin April 29, 2014

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

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2014

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.

Sys Admin May 1, 2014

Hi Fidel,

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

Regards

Sumit

Sys Admin May 1, 2014

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

Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2014

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.

Sys Admin May 4, 2014

Hi Fidel,

Thank you very much for your reply. We understand

Regards

Sumit

1 vote
Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2014

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

Tim Cullings July 16, 2014

That did it, Thanks!

0 votes
Tanuj Bhandary January 24, 2020

I was having same issue as Mike Wells was but as in latest version there is no plugin feature. It is just showing that create link issue give story as blocks or is blocked by, but the problem is, it is not getting block. For e.g If Parent issue is X and Child issue is Y so until the Y issue has been closed X issue cannot be close but in my case it is still can close X.So i want some help in this.

My Jira software is an latest and also a Free plan, so i have to purchase the standard plan for advanced permission?

0 votes
Tim Cullings July 16, 2014

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?

Tim Cullings August 12, 2014

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

0 votes
Sys Admin May 1, 2014

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
0 votes
Marcus Silveira
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 24, 2012

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

Mike Wells
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2012

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events