how to add a user only to those tickets that were created from the mail "mypost@gmail.com" ? I think to do it through POST-function , but I only have part of the code
import com.atlassian.jira.component.ComponentAccessor
def userManager = ComponentAccessor.getUserManager()
def watcherManager = ComponentAccessor.getWatcherManager()
def watcher = ["username1","username2"]
watcher.each{userName->
def user=ComponentAccessor. userManager.getUserByName(userName)
watcherManager.startWatching(user, issue)
}