Set Issue Field - JMWE

RIZKY JTUASIKAL April 9, 2023

LOB.PNG

 

I have 2 fields, LOB(User) and New LOB.

How do I do it, when I select the value "Wholesale Banking" or "Wholesale Funding" from the LOB(User) field, the value of the New LOB field will automatically change to "LOB Wholesale Banking Group"

if LOB User = Commersial Banking Supply Chain, set New LOB = LOB Wholesale Banking Group

can anyone provide an example query?

2 answers

1 accepted

1 vote
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.
April 10, 2023

Hi @RIZKY JTUASIKAL 

you need to use a Set Issue Fields post-function, select the New LOB field as the field to set, and for the value use something like this:

{%- switch issue.fields.customfield_12703.value -%}
{%- case "Commersial Banking Supply Chain" -%}
LOB Wholesale Banking Group
{%- endswitch -%}

Notice the "{%-" and "-%}" that are "absorbing" whitespace created by the newlines. Without them, you'd need to write this:

{% switch issue.fields.customfield_12703.value %}{% case "Commersial Banking Supply Chain" %}LOB Wholesale Banking Group{% endswitch %}
RIZKY JTUASIKAL April 10, 2023

Hi @David Fischer ,

 

thank you for the answer.

 

LOB.PNG

is it like this ?
"customfield_12703" is the LOB User field


but when I tried it, I didn't get any results

is there something wrong with my settings? :(

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.
April 10, 2023

Well, it depends on a few things. First of all, the values (both the case value and the resulting value) are case-sensitive and space-sensitive. You also need to make sure there is no trailing space in the values of the New LOB 2023 field.

Then, is customfield_12703 a single-select custom field? When you "test" the value in the editor against an issue that has the "Wholesale Banking" value, do you get "LOB Wholesale Banking Group"?

RIZKY JTUASIKAL April 10, 2023

Well, it depends on a few things. First of all, the values (both the case value and the resulting value) are case-sensitive and space-sensitive. You also need to make sure there is no trailing space in the values of the New LOB 2023 field.
>> I think this is the cause


Now it works :)

Thank you so much @David Fischer 

0 votes
RIZKY JTUASIKAL April 10, 2023

I tried this query, 

 

{% switch issue.fields.customfield_12703.value %}
{% case "Commersial Banking Supply Chain" %}
LOB Wholesale Banking Group
{% endswitch %}

 

is there something wrong with the query?

Suggest an answer

Log in or Sign up to answer