You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.