Hello
I'm currently validating my upgrade from JIRA7 to JIRA8. Amongst my custom scripts, we had changed the email velocity files to include on 'comment added' event the history of (up to) 3 last comments. This was to help having a context.
The way I retrieved the comments was by getting the commentManager as follow:
#set ($componentAccessor = $constantsManager.getClass().forName('com.atlassian.jira.component.ComponentAccessor').newInstance())
#set ($commentManager = $componentAccessor.getCommentManager() )
However, now due to restrictions in security in JIRA8, it seems I ca no longer use the getClass method, hence this gives an error.
How can I get this manager now ?
Regards
Hi Gaël,
we were facing the similar issue after our Jira upgrade into version 8.x.
There is related question for NumberTool (https://community.developer.atlassian.com/t/velocity-numbertool-use/40801), from where you can implement required adjustments.
Therefore your script code snippet within velocity template file should be updated into:
#set ($componentAccessor = $ctx.get("jirautils").loadComponent("com.atlassian.jira.component.ComponentAccessor", $ctx.getClass()))
#set ($commentManager = $componentAccessor.getCommentManager() )
Please try and mark this answer as accepted/solved, if it works for you.
Have a good day !
We were using this to pull watchers into emails and found the following workaround.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaël,
could you figure out how to overcome this issue?
We just saw the same in our instance after upgrading.
Thanks
juergen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Juergen,
unfortunately I haven't been able to fix this issue, despite searching and scratching all of jira velocity doc and related articles...
So I had to give up this piece of functionality and return to normal old script.
If you ever find a way to get it working, I'm eager to know ;)
Regards
Gael
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.