Scriptrunner version 6.49
In my listener I am getting issue like this:
def thisIssue = event.issue as MutableIssue
I am shown a static error like this
[Static type checking] - No such property: issue for class: com.atlassian.jira.event.AbstractEvent @ line 31, column 96.
Can you please let me know what is best way to get current issue in event listener.
Generally, you can ignore the static type checking error. Groovy can't know before run time that the event is an IssueEvent, so it can't determine that there is an issue property.
BTW - I don't see that error in my version of ScriptRunner. However, if you want to clear up that error, you can do this:
def thisIssue = ((IssueEvent)event).getIssue() as MutableIssue
As a general practice, you are better off using the getter/setter functions than accessing the properties of an object directly.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event