Validate that there is a reject type sub task before allowing a transition

Oded Priva April 30, 2014

Hi,

I want to check that there is at least one 'reject' type sub task before allowing 'send to developer' transition.

How can I achieve it?

1 answer

1 accepted

1 vote
Answer accepted
Boris Georgiev _Appfire_
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

Here's the code for condition or validator:

issue.getSubTaskObjects().collect { it.issueTypeObject.name }.contains('reject')

JamieA
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 2, 2014

or:

issue.subTaskObjects.any {it.issueTypeObject.name == "reject"}

Boris Georgiev _Appfire_
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 2, 2014

Yes that's even better.

Oded Priva May 2, 2014

Thanks guys! ... One more question .. Can I validate that this reject subtask is also in "open" status ?

O.k got it ( I think .. )

issue.subTaskObjects.any {it.issueTypeObject.name == "Reject" && it.getStatusObject().name == "Open"}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events