Where are you (aiming to be) running this? Is it an event listener, or a post-function?
Ok, you're jumping through unnecessary hoops with the issuemanager line. You could make it work with a bit more wrangling, but there's a far easier route. Try replacing it with simply
def issue = event.issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This suggests that you are not using the script in a listener.
As you can see in this example, the code you have is perfectly valid when used in the context of a listener - https://library.adaptavist.com/entity/update-the-value-of-a-custom-field-using-a-listener
Note - the way scripts have a context makes it hard to write and test them if you put them in the wrong context. For example, if you're writing a listener, you need to put the code into a listener, you can't develop in the script console because the console will not have the "event that was caught" in the context. Similarly for conditions, post-functions and validators - the console does not have "issue the transition is running against" in the context.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.