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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,901
Community Members
 
Community Events
184
Community Groups

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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 29, 2021

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?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 29, 2021

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 30, 2021

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
AUG Leaders

Atlassian Community Events