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,585
Community Members
 
Community Events
184
Community Groups

Adding usert to watchers Post-Function

hi.

i've found that script on your side (https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html) i'm trying to use clone issue and link post-function and i need to add one custom user to watchers. I've tied to use script but id doesn't work:

import com.atlassian.jira.component.ComponentAccessor

def watcherManager = ComponentAccessor.getWatcherManager()
def userManager = ComponentAccessor.getUserManager()

doAfterCreate = {
def userKeyToAddAsWatcher = "anuser"
def watcher = userManager.getUserByKey(userKeyToAddAsWatcher)

if (watcher)

{ watcherManager.startWatching(watcher, issue) }

else {
log.warn("User with key: $

{userKeyToAddAsWatcher}

does not exist therefore would not be added as a watcher")
}
}

 

Do you know how to resolve this?

1 answer

1 accepted

1 vote
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 10, 2018

Hey

Wow that was a quick reply:)

 

Tkanks - i've made it work

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 11, 2018

You are welcome!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events