Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find the Reporter's language in Groovy

Paul Wilkinson
Contributor
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 Champion
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
Contributor
October 22, 2022

Hi,

It works.

Thanks a lot

0 votes
Alex Koxaras -Relational-
Community Champion
August 31, 2022
Paul Wilkinson
Contributor
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 Champion
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
Contributor
October 22, 2022

Hi,

On an PF. 

App is JMWE.

Paul

Suggest an answer

Log in or Sign up to answer