I use scriptrunner to automate a lot of processes in Jira. Thanks a lot for this great addon to Jira.
But now I come up with a question: I want to add a new web item (with a web section and more web items) in the top navigation menu.
I used the tutorial https://scriptrunner.adaptavist.com/latest/jira/fragments/WebItem.html to do this and it works perfectly. But now I want to translate the menu text depending on the users locale.
So my next try was to use the Web Item Provider Built-In Script (https://scriptrunner.adaptavist.com/latest/jira/fragments/WebItemProvider.html). I can code the label depending on the user setting, but now I cannot choose the created web item as parent for the web section (the dropdown doesn't list the key from the web item provider).
So either I use the web item but without menu text translation or I use the web item provider with menu text translation but without any chance to integrate further items (here: web section) as children of the web item.
My problem is, I need both :) Do you have any ideas?
I use Jira 8.13.3 (Server / self hosted) and Scriptrunner 6.18.0.
Thank you for your replies.
I solved the problem by duplicating the Web Item, Web Section and Web Item Provider. I use the condition to check the users locale and to decide which option to go for.
My condition is:
ApplicationUser loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
String userLocale = ComponentAccessor.getUserPreferencesManager().getExtendedPreferences(loggedInUser).getString(PreferenceKeys.USER_LOCALE)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events