how to forbid workflow transitions for released versions?

ViktorT November 16, 2011

how to forbid workflow transitions on the issues which have released version in fixVersion field?

if fixVersion is unreleased (probably every assosiated version is unreleased) then transitions should be available.

tnx

2 answers

1 accepted

2 votes
Answer accepted
Dieter
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.
November 16, 2011

This condition seems a little bit exotic and in this case Groovy enters the field for me. I'd suggest this Groovy workflow condition, of course you must have the Groovy Script Runner Plugin installed.

passesCondition = true
versionManager = ComponentManager.getInstance().getVersionManager()
releasedVersions = versionManager.getVersionsReleased(issue.getProjectObject().getId(), true)
versions = issue.getFixVersions()
if (releasedVersions != null && versions != null) {
versions.each() {
if (releasedVersions.contains(it)) {
passesCondition = false

}
}
}

ViktorT November 17, 2011

i believe this should be it, just all of a sudden the issue's become unnecessary. but tnx for idea, i'll keep in mind that script plugin, looks like a very helpful tool. tnx for answer.

0 votes
Dieter
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.
November 16, 2011

This condition seems a little bit exotic and in this case Groovy enters the field for me. I'd suggest this Groovy workflow condition, of course you must have the Groovy Script Runner Plugin installed.

passesCondition = true
versionManager = ComponentManager.getInstance().getVersionManager()
releasedVersions = versionManager.getVersionsReleased(issue.getProjectObject().getId(), true)
versions = issue.getFixVersions()
if (releasedVersions != null && versions != null) {
versions.each() {
if (releasedVersions.contains(it)) {
passesCondition = false
break
}
}
}




Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events