Degraded performance Customers may experience intermittent errors using Community search. Our platform vendor is investigating.
It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
I have a condition I wrote to hide a transition unless there is an issue with the type "Problem" linked to the current issue. When I test the code in ScriptRunners code console against different issues it results in True and False as would be expected for the test issues. The problem is when I put in in the workflow on the transitions condition tab the transition never gets hid. I write to the log the result of the condition and can see the false result, but the transition is still available. Thoughts on what I am missing/not understanding causing the transition to still show even when the below code results in False?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
Boolean passesCondition = false
def type =[]
def linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getOutwardLinks(issue.id)) {
type.add(link.getDestinationObject().getIssueType().name)
}
for (IssueLink link in linkMgr.getInwardLinks(issue.id)) {
type.add(link.getDestinationObject().getIssueType().name)
}
for (item in type) {
if(item == "Problem"){
passesCondition = true
}
}
passesCondition
log.warn (passesCondition)
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.