Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to prevent a Story to be closed when is blocked by a Bug using the Automation rules?

mvmtori March 17, 2023 edited

Hello,

We need to have the ability to prevent a Story to be set to "Done" when a Bug is blocking the story and it is still open as well.

Is there any way to set this by using the automation rules? I have tried but without success.

This is the workflow the Story issue type has configured in our jira instance:

Story workflow.png

Basically, what we need is to satisfy the following criteria:

IF

issue type = "Story" AND status is not "Done",

AND issue link type is "blocked by" (preferably a "Bug") AND status of linked issue is not "Done",

THEN

issue type = "Story" cannot be moved to "Done"

 

Could you please tell me if this is technically feasible or do we need to use another feature?

 

Many thanks!

Victoria.

4 answers

1 accepted

1 vote
Answer accepted
mvmtori March 27, 2023

Hello Najm @Najm Polaris , Patricia @Patricia Francezi!

Thank you for your support. I finally found the solution that it works for our scenario.

Here it is:

Automation rule - Stories blocked by open Bugs.png

 

Regards,

Victoria.

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2023

Hi @mvmtori 

Good you had your problem solved. 
I would like to add again, that this solution dont prevent the status to be changed. 

Your question was about preventing it. 

Your solution is good and serves you, but for the ones who find your accepted answer may seen that the full scenario was achived. 

You are just moving the status from another one if the condition is not match. Not preventing it to happen. 

 

Regards

mvmtori March 31, 2023

Hi @Patricia Francezi Patricia!

In my case, it does prevent it. If i move a story from any status to "Done" (or any status defined in the group of "closed" issues), if the story has a bug blocking the story and that bug isn't resolved yet, the story goes back to the status defined (in my case, to "Waiting" as that is the most representative status we have to say to the JIRA user, the Story is waiting until de defect is no longer blocking it).

Thank you for all your feedback and comments!

Victoria.

1 vote
Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 17, 2023 edited

 

Hi @mvmtori 

The workflow conditions has the linked issues as a field we can compare string to block the transition,, BUT i couldnt find any use case to know how to configure it. 

Another solution I thought about

- Create a hidden field (like a check box) that is checked when the issue is linked to a blocks using automation

- WHen all blocker issues are close, edit this field and clear it. (here is an answer for this scenario - my question and the answer feets for your purpose https://community.atlassian.com/t5/Jira-Software-questions/Help-with-a-linked-issue-rule-please/qaq-p/2295972#M255069 )

- In the workflow create a condition for done transition checking this field. 

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2023

Hi @mvmtori 

Let me clarify my steps, and add some information

To prevent the issue to move to done, you need to configure your workflow to prevent it.

Just the automation rule is not enough to prevent your scenario. 

Then 

1) You need to create hidden field to store the fact that the issue had a linked issue that blocks it. 

In case you prefer create a custom field, lets say you name it "Blockers", as a checkbox field type

https://support.atlassian.com/jira-cloud-administration/docs/create-a-custom-field/

During custom field creation, it will request to associate to the screens in the projects you want it to be shown . 

If you want more information about screens here is the kb

https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-screens/

You also need to hide the field from the users so they cant change the value mannually 

https://support.atlassian.com/jira-work-management/docs/configure-field-layout-in-the-issue-view/#Configurefieldlayoutintheissueview-Hiddenfields

 

1.1) OR - you can use the flag field that is already used to show impedment on Jira boards. This will sufice.

In this case you already have the field in the project and its screens and dont need one more. 

The caveat for this is that the users can take the flag off the issues mannually. 

2)  You need an automation to set this field or set the flag on in the issue like this one

image.png

The same rule can be used to set the custom field you created - i suggested the same type of fields. 

 

3) Now you have to configure your workflow to prevent the done status to be shown to the user if there the field is still filled up (the custom one or the flag)

More info in to how to get to the transition condition configuration on your workflow 

https://support.atlassian.com/jira-cloud-administration/docs/configure-advanced-issue-workflows/#Conditions

You are going to use "Value Field" condition, and the screen should be filled linke this 

image.png

Then add and publish the draft workflow. 

 

4) You will need a rule to take of the flag or the custom field, when all the blockers issues are closed. 

And this you can get from this answer here 

https://community.atlassian.com/t5/Jira-Software-questions/Help-with-a-linked-issue-rule-please/qaq-p/2295972#M255069

 

I hope this helps.

And - for that complex rules and scenarios I also reccomend you to use free courses in Atlassian University, so you will know more about the features in Jira platform for you own good. 

Like • Natasja Eloff likes this
0 votes
Najm Polaris
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.
March 23, 2023

@Patricia Francezi Thank you for the detailed solution. It is absolutely brilliant.

 

@mvmtori You should try her detailed solution it should work. I have created a demo for my automation just for help here

0 votes
Najm Polaris
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.
March 18, 2023

Hi @mvmtori

you can do it using automation as seen below but just add your first condition about the ticket being a user story and not in done by using the if condition. 

 

download (7).png

mvmtori March 20, 2023 edited

Hello @Najm Polaris Najm!

I tried this other rule but it is not working either :(  - Can you please advise whether is something wrong in the rule?

Automation rule - Stories blocked by.png

Many thanks in advance!

Victoria

Najm Polaris
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.
March 20, 2023 edited

Hi @mvmtori ,

Your second condition was wrong, instead of using "is blocked by" you used "blocks". I have simplified the automation try this one below. 

download (6).png

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2023

To add information on the rule provided by @Najm Polaris

If i understood your scenario, you want to prevent /block the transition to done if there are blocker issues. 

Automation does not prevent a transition to happen.

If you want to prevent, you need to use conditions or validators as i mentioned in my answers. 

Like • Najm Polaris likes this
mvmtori March 21, 2023

Hello Najm @Najm Polaris , Patricia @Patricia Francezi 

Thank you very much for replying to my questions.

I tried to combine both answers provided by you, I tried so many different combinations but unfortunately none of them worked.

 

This is the last one I used:

Automation rule - Stories blocked.png

I am probably missing something you Patricia explained to me that I didn't understand.

I truly appreciate if you can take at look and see what might be wrong.

I can still move the story to DONE, even when it has open bugs blocking the story =(

 

Regards,

Victoria.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events