Summary: Within JIRA Administration -- Advanced -- Services, I'd like to "Add Service" to "Run Jelly script" that would add watchers to many Parent Issues. I have no experience with Jelly scripting.
Using Jelly Script, can someone create the code framework to accomplish the following:
My goal is to "Add Service" and run this code each day.
Thank you for your consideration and guidance.
Community moderators have prevented the ability to post new answers.
OK, here it is... I've not really tested, I'll leave that to you.
Before installing as a service, you can (must) test it in the script runner admin panel. You can put the file on the server, then in the admin panel point to that, and Run.
After that it's easier to install a service which will run every X minutes.
I've left some debug statements in there which you can remove if/when it works.
Jamie --- thanks so much for this; please give me a day to incorporate; your work is amazing. Take care, Tyler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries - I used a project key called JRA, you need to change that to project X or whatever. Give me a shout if you have any problems.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie! Will do! SAF and Mancini were going at it, yesterday, ehh?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great Stuff! Thanks to Groovy the implementation almost reads like the specification :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie, thanks again for all of your help and guidance.
Through Script Runner, I've transferred your code (adjusting for projectKey and roleName specifics) to the Script Engine (Groovy type) and pressed Run. Here is the main error message:
I received a few other error messages (Null Pointers), but believe I caused those by commenting out each (from the start and stop sections) log line (lines 39 and 46) and the start/stop watching commands (lines 40 and 47).
Thanks for your help, Tyler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tested it on 4.4.3 and it worked...
Dieter, I agree. Groovy cuts out all the boilerplate in java where you have to search through 10 interfaces and 5 abstract classes to get to the little bit of business logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Like I said, I didn't test it ;-)
What jira version is it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> received a few other error messages (Null Pointers), but believe I caused those by commenting out each (from the start and stop sections) log line (lines 39 and 46) and the start/stop watching commands (lines 40 and 47).
Don't really understand that - could you paste your code up to gist.github.com. You can comment out the stop/start watching but don't comment out the .each{}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie, thanks again for leading me through this.
I think I did the gist posting correctly: https://gist.github.com/2569617
Update:
EDIT ---> Sorry, I forgot to include JIRA version: v4.4.4
Thanks Jamie, Tyler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post the first few lines of the NullPointerException?
> I've made sure that there exist the correct projectKey and roleName
Yes, minimal error checking so they need to exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Heh... I don't care about any team that isn't Arsenal ;-)
Sorry, I will need the full stack trace. Can you post to gist. I'm wondering if you have a problem with your indexes - can you incorporate the changes from https://gist.github.com/2575893 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie, here are the first few lines:
>> javax.script.ScriptExcepton: javax.script.ScriptException: java.lang.NullPointerException
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEnglineImpl.java:117)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngline.java:216)
at com.onresolve.jira.groovy.GroovyRunner.runFile(GroovyRunner.java:99)
at com.onresolve.jira.groovy.GroovyRunner.run(GroovyRunner.java:50)
at com.onresolve.jira.groovy.GroovyRunner.doExecute(GroovyRunner.java:220)
at webwork.action.ActionSupport.execute(ActionSupport.java:165)
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:76)
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
at webwork.intercetpor.GenericDispatcher.executeAction(GenericDispatcher.java:205)
Madrid could wrap up the domestic league today, no? Red Devils... destiny out of their control now -- that drubbing to City (@ Old Trafford) really killing the goal differential...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gunners --- I see where you are now. :) Arsene Wenger is the man --- and RVP has a deadly left side.
Update ----- Jamie, I'm sorry, I just retested and noticed that I have a ton of watchers on the parent issue of a subtask with the YYYYYY summary. While I'm still receiving the Null Pointer Exception, your ORIGINAL CODE does complete the task set out by the specs. Please give me a moment to incorporate your updated code from gist 2575893.
Thanks Jamie, Tyler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
Sorry for my delay; two points / questions:
Thanks, Tyler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm listening to it in the background ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie -- I appreciate this (hope I'm not taking you away from the important Derby).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes... it's actually quite a complex task (almost impossible in jelly)... I'll put something together but can't guarantee it will work right off the bat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie, can the code be set up to execute every X minutes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie --- I've installed the script runner plug-in >>> karma is yours!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you be prepared to install the script runner plugin to do this via a service written in groovy? If so I'd give you the code, for a guaranteed karma influx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.