I followed @jamie-echlin's instructions to create my own script available on the classpath, and it is visible/runs from the PLugins>Built-In Scripts page.
However I want it to also show as a post-function, so I tried adding both "Function" and "Listener" to the categories with no luck.
List getCategories() { ["ADMIN","Function","Listener"] }
I'd prefer not to just use the full path to the file because then I would need to hard code the arguments rather then using parameters
Workflow Script Post-Function screen
Admin Screen
By the way, my end goal is to populate a custom field based on the summary of an email-generated ticket, so if anyopne has an alternate approach let me know.
Community moderators have prevented the ability to post new answers.
I just tested this and it worked fine, which surprised me a bit.
It will only show in the post-functions, then you have to click the post-function labelled Script Post-Function, and it will be in there.
But I see you have done that so I have no idea. Oh actually.... the package needs to be this or under this: com.onresolve.jira.groovy.canned.workflow.postfunctions
I bet that's the problem. That's a bit pants, sorry.
> By the way, my end goal is to populate a custom field based on the summary of an email-generated ticket, so if anyopne has an alternate approach let me know.
What are you planning to do - read a mailbox and generate tickets? If so don't you want a service...?
Oo, I'll give that a try first thing this morning, thanks Jamie!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Woot!
Changed the package as suggested AND moved to the same folder structure in WEB-INF/classes.
Function shows up as expected now - Thanks Jamie!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doh, now I am getting an NPE. (even running from admin console)
javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117) at javax.script.AbstractScriptEngine.eval(Unknown Source) at com.onresolve.jira.groovy.GroovyRunner.runFile(GroovyRunner.java:110) at com.onresolve.jira.groovy.GroovyRunner.run(GroovyRunner.java:61) at com.onresolve.jira.groovy.GroovyRunner.doExecute(GroovyRunner.java:244)
Any advice for setting a cascading select from groovy script? I'm sure you have a nifty library that does it in one easy call!
This page is poorly written, and full of errors, https://confluence.atlassian.com/display/JIRACOM/How+to+Set+the+value+of+a+cascading+select+list+in+an+issue.?from=sac_createissue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nm, i'm an idiot. Returning null from your method when a map is expected is a good way to cause NPEs!
Also for anyone else working to update cascading select lists with Jamie's plugin, I added my short snippet as a comment to this page https://confluence.atlassian.com/display/JIRACOM/How+to+Set+the+value+of+a+cascading+select+list+in+an+issue.?focusedCommentId=394464833#comment-394464833
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You seem to be hitting some of the more obtuse problems in the code. BTW the code you forked is not uptodate... if you send me your bitbucket id to myfirstname dot mylastname @gmail.com I will give you read access to the live repo.
But, I'm away for a while now, will be towards the end of next week...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the delay @Jamie. It did not work.
After a restart script continues to show in "built-in" but not "post-functions"
I would be happy to provide the script or anything else you would need if you want to try and re-create the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it should be compiled on the fly, but do try restarting... LMK if that works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately no. I'll add the contrasting screenshots between the post-function view (after choosing "script post-function") and the admin run screen.
No error shows in logs, and I don't think it is a compilation issue as I can view and run it from the "built-in scripts" page (see 2nd screenshot)
Wondering if I need to restart JIRA, I assumed the classpath for groovy post-function compilied on the fly too (like it is for the built-in script page) - but perhaps not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the list of post-functions, you need to click "Script function" (or similar, and it should show there). Doesn't it?
If not check the logs at the time you click the "script function" link, if there are compilation errors it won;t be shown but a message will be logged.
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.