Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner validation transition where there must be at least one linked issue with no resolution

Sandy King February 29, 2024

Hi there, 

I have a situation where the customers want a "Blocked" status for issues. Whilst I have advised that this will often lead to orphaned or forgotten issues sitting in this status, we have come to a compromise. 

In order to transition an issue to a blocked status there must be at least one linked issue that "blocks" the issue, and it must be un-resolved. On those issues being resolved I will set up automation to "un-block" the issue.

Looking at: https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/jira-expression-examples#linked-issues

I've come up with the following script runner validator that I think should serve: 

issue.links
.filter(l => l.type.inward == 'is blocked by')
.some(l => l.linkedIssue.resolution == null)

 

However always returns false

I've also tried l.type.outward and "blocks" variations of the validator to no success.

Any help would be greatly appreciated, thank you.  

 

1 answer

1 accepted

0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
February 29, 2024

Hi Sandy,

I believe you may want to update your code to be similar to the example here on line 81 as this should validate that the issue has at least one issue linked to it with the link of 'is blocked by' and does not have the resolution set.

I hope this helps.

Regards,

Kristian

Sandy King February 29, 2024

Success thank you so much. I was also missing a capital "I" in "Is blocked by". But is now working. 

issue.links.some(l => l.type.inward == 'Is blocked by' && l.linkedIssue.resolution == null)

 

 

Kristian Walker _Adaptavist_
Community Champion
February 29, 2024

Hi Sandy,

I am glad you got your validator working

Regards,

Kristian

Like Sandy King likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events