You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Script Runner V 6.56
At Create getting error "Cannot Invoke method getStatus on a null object" at Create in Script Runner Behavior Script
def issue = getUnderlyingIssue()
def IssueType= getIssueContext().issueType.name
def issuseStatus = issue.getStatus().getName()
def fixVersions = issue.fixVersions
I am not a scripter so any assistance on how to resolve the above error will be appreciated
But it doesn't have a status yet. How is it possible to return something else but null?
Let's go again and I hope that you will figure it out:
I understand that at create issue the issue type and status are unknown. But the Behavior fires at the Create issue event. You really don't need to be condescending. You told me to remove the
def issueStatus = issue.getStatus().getName
I was just telling you that I need that line.
Sorry if you misunderstood my reply. There wasn't any bad intention to it. The behaviour doesn't fire at the issue created event. The issue created event is fired as a post function after the transition takes place. You want to keep that line and that's fine. But to answer your initial question, you can't solve this problem, because that line, where you've placed it, will always return null.
If you describe your business requirement and what you want to achieve, I might be able to help you out.
We are using a behavior to validate at certain states that the fix version is a valid delivery version. We want to use a behavior because when you use a validator on a transition the users can update the Fix version back to an invalid delivery in-between transitions in the edit screen