Unflag an issue if all the blocking issues are resolved.

Hitendra Chauhan January 6, 2020

Is there an easy way to unflag an issue if all of its blocking linked issues are resolved.

I don't find any plugin that can help to solve this request. Is custom development is the last option ?

Following is the description:-

Let say B is the current issue on which a transition is made and it is the blocking issue for issue A, where A is flagged.

Post function to be added in a specific transition.

Following calculation and action needs to be done.
1. Find the issue A which is linked ("is blocked by") to the current issue B.
2. Find the list of the issues and their status which are linked ("blocks") to issues A.
3. Check the statuses of issues found in step 2.
a) If atleast an issue is not Resolved. Do not do anything.
b) If all the issues are resolved, clear the flag of issue A.

3 answers

2 accepted

0 votes
Answer accepted
Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 7, 2020

Hi @Hitendra Chauhan ,

while your scenario might not be doable out of the box, a workflow app like Jira Workflow Toolbox might help here using its Update issue fields post function.

The result might look like this:

unflag.PNG

Some additional explanations:

Target issue

Starting from your issue B, we're defining the target issue with the expression

linkedIssues("blocks")

that returns issue A.

Target fields

In order to delete the flag, the Flagged custom field (created by Jira Software) has to cleared.

Conditional execution

This is the 'fun' part. Since your requirement states that the flag should only be removed, if all blocking issues are resolved, you have to use an expression like

count(filterByResolution(linkedIssues("is blocked by",linkedIssues("blocks")),"")) = 0

 This expressions counts all the unresolved blocking issues and returns true if no issues are found (that said all blocking issues are resolved).

It's important to place this post function after the one setting the resolution of your current issue.

Cheers
Thorsten

Hitendra Chauhan January 7, 2020

@Thorsten Letschert _Decadis AG_  : Thanks, I got an idea with your code snippet. Unfortunately I can't use Jira Workflow Toolbox as we use Script Runner for such sort of automation. 

I am almost done with the code using script runner. It may need some optimization which I think I can do.

Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 7, 2020

Hi @Hitendra Chauhan ,

thanks for the feedback. Glad to hear you've found a solution!

0 votes
Answer accepted
Adrian Stephen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2020

Hi @Hitendra Chauhan 

 

I am not able to find any plugin which has this feature built-in already. 

I believe you might be able to achieve this using scripts via scriptunner plugin:

https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira

 

It may be a good idea of exploring this plugin and if you have any questions around the usage of this plugin, you may contact scriptunner support :

https://productsupport.adaptavist.com/servicedesk/customer/portal/2/user/login?destination=portal%2F2

Hitendra Chauhan January 7, 2020

Thanks @Adrian Stephen  : I was able to achieve the automation using Script Runner.

Like Adrian Stephen likes this
Adrian Stephen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2020

That's awesome! Glad to hear that @Hitendra Chauhan . Cheers

0 votes
Caroline_Brown April 17, 2020

Thank you for giving me some ideas on how to solve this as I had exactly the same issue!

Suggest an answer

Log in or Sign up to answer