Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Issue manager method not found

Hi Im working with this code dont know where im going wrong. But im getting this errorissue manager.jpg

1 answer

0 votes

Where are you (aiming to be) running this?  Is it an event listener, or a post-function?

Script listener in script runner... Also is there a possibility to get the issue key dynamically for events triggered?

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

But I'm getting variable event undeclared

Im getting this error

event undeclared.jpg

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

🤺 Atlympic Event: Partnerships

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

89 views 0 6
Read article

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you