Forums

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

JIRA server plugin rest api grid field

Amir Khan IIND
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2022

Im newbe in creating JIRA plugins, I need to get to the value "English"/ "French" and "C1 - Advanced"/"A2 - Pre-Intermediate" to achieve something like this:

English - C1 - Advanced French - A2 - Pre-Intermediate

I know, that it was update of grid fields and my plugin not working because of actual json format:

{"customFieldId":13001,"rows":[{"rowId":"row_1e886e1b-a0d5-463c-95b2-21f7372531f3","columns":{"LangName":{"label":"English","value":"English"},"LangLevel":{"label":"C1 – Advanced","value":"C1"}},"order":0},{"rowId":"row_be211217-476a-4d6f-92fe-30015f1cba03","columns":{"LangName":{"label":"French","value":"French"},"LangLevel":{"label":"A2 – Pre-Intermediate","value":"A2"}},"order":1}]}

This is my code before grid update:

CustomField lang = cfm.getCustomFieldObjectsByName("Languages").stream().findAny().orElse(null);
if (lang != null) {
if (lang.getValue(issue) != null) {
log.debug("JSON of languages:\n", lang.getValue(issue).toString());
LangRoot langObj = gson.fromJson(lang.getValue(issue).toString(), LangRoot.class);
List<CVForeignLanguage> cvLangList = new ArrayList<CVForeignLanguage>();

if (!langObj.getRows().isEmpty()) {
for (LangRows row : langObj.getRows()) {
CVForeignLanguage currentLang = new CVForeignLanguage();
currentLang.setForeignLanguageLevel(row.getColumns().getLangLevel());
currentLang.setForeignLanguageName(
langSelected ? LangTranslator.lang2eng(row.getColumns().getLangName())
: row.getColumns().getLangName());
log.debug("Adding row of language: {}.", currentLang);
cvLangList.add(currentLang);
}

I will be such grateful for help.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events