This is more of a groovy question but within the context of scriptrunner.
When you create a script there are a number of variables bound to the script but the IDE (IntelliJ) doesn't know about them. e.g. if I create a script field, "issue" is a bound variable
As you can see, "issue" has a dotted line and there is no auto-completion
One way to remedy this is to use "as Issue" everywhere
but that can get cumbersome
InteliJ does allow you to define Dynamic Properties for scripts but the interface is all point and click, one variable at a time, one script at a time. It would be so much simpler if there was an annotation or something.
I dug through the IntelliJ code looking for a way to extend the groovy plugin so I could apply these to a namespace but didn't have any luck. :( Grrrr, I spent too much time looking at that.
The best I could come up with was something like this
import com.atlassian.jira.issue.Issue
Issue issue = binding.variables.issue
String projectName = issue.projectObject.name
Will this cause any issues with groovy due to 2 variables with the same name?
Is there a better way?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.