Hi Community,
How can I get object of ExtendedSystemInfoUtils in scriptrunner? ComponentAccessor is unable to get this component.
ComponentAccessor.getComponent(ExtendedSystemInfoUtils) is always null
Jirs api: https://docs.atlassian.com/software/jira/docs/api/7.1.4/com/atlassian/jira/util/system/ExtendedSystemInfoUtils.html
Hi @scriptIt
I ran a quick test in my environment and didn't encounter any issues.
If you observe the screenshot above, I can invoke the ExtendedSystemInfoUtils and access its methods:-
To proceed, could you please clarify what version of Jira and ScriptRunner you are currently using?
I am looking forward to your feedback and clarification.
Thank you and Kind regards,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_ ,
Thanks for your answer.
Jira version: 9.4.8
Scriptrunner version: 7.12
Output:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @scriptIt
Ok, so if you want to declare the ExtendedSystemInfoUtils object, you can't directly use the ComponentAccessor.
Instead, you need to use the ComponentAccessor to invoke the I18nHelper object. Once you have invoked it, you need to pass it to the ExtendedSystemInfoUtils constructor as shown below:-
import com.atlassian.jira.util.I18nHelper
import com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl
import com.atlassian.jira.component.ComponentAccessor
def i18nHelper = ComponentAccessor.getComponent(I18nHelper)
def extended = new ExtendedSystemInfoUtilsImpl(i18nHelper)
extended.usageStats
Below is a screenshot of the output returned:-
If you observe the screenshot above, I can get the result.
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
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.
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.