It is mentioned on the Script Runner Marketplace page, the ability to 'Automatically add watchers' and also 'Sending a custom email on a transition'. These 2 I would like to try, but would appreciate if you someone can point me to which part of the docs I should review on how to implement these? Possibly I am just not finding it in the documenation link that is provided, Thanks!
Hi Shari... thanks for your review. Should have known there's no such thing as a free lunch ;-)
The built-in script add watcher simply adds the current user to comment or do a transition as a watcher. This is pretty much superfluous now as since it was written, jira by default adds any participant as a watcher.
If you want to add someone other than the current user, create a script file with the contents:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.watchers.WatcherManager def watcherManager = ComponentAccessor.getWatcherManager() def user = ComponentAccessor.getUserManager().getUser("someuser") watcherManager.startWatching(user, issue)
And create a post-function or listener (Scripted function from the list) and point to this file.
Sending a mail with a custom template is described here: https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail
In regards to the WATCHER portion of this question, I did find this in another ANSWERS post, but I am not sure about where exactly to save the file, and if it should jsut be a text file with .groovy as the extension ? Also, if this has been used with the Script Runner plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Save it anywhere... yes just plain text with .groovy extention.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
take a look at the built-in scripts.
This links probably will help you to achieve what you want:
https://jamieechlin.atlassian.net/wiki/display/GRV/Script+Runner#ScriptRunner-Built-inScripts
https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-SendCustomEmail
https://jamieechlin.atlassian.net/wiki/display/GRV/Listeners#Listeners-AddWatcher
Cheers
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.