How can I find the Reporter's language in Groovy

Paul Wilkinson August 31, 2022

Hi,

Can anybody suggest how to retrieve the Reporter's language so that I can use it in a Groovy Script condition?

I tried this:

issue.get("reporter")?.language=="German"

but it does not work.

Thanks for help

Paul

 

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2022

@Paul Wilkinson ,

In a JMWE groovy script, you can use this code:

import com.atlassian.jira.user.UserLocaleStore;

UserLocaleStore localeStore = getComponent(UserLocaleStore);
def locale = localeStore.getLocale(issue.reporter);
locale.language == "de"
Paul Wilkinson October 22, 2022

Hi,

It works.

Thanks a lot

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2022
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2022
Paul Wilkinson August 31, 2022

Thanks for you fast reply.

I found that suggestion but I do not understand how to use it in groovy script.

Can you suggest how?

Paul

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2022

@Paul Wilkinson where do you place that code you want to write? On a PF within a workflow? On a listener? Which app do you use?

Paul Wilkinson October 22, 2022

Hi,

On an PF. 

App is JMWE.

Paul

Suggest an answer

Log in or Sign up to answer