Forums

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

Emulating JQL "in" functionality in Nunjucks?

Olap
Contributor
June 12, 2018

In JQL, I can write customer in ("customer A", "Customer B", "Customer C")

 

What would be the equivalent in Nunjucks? How can I create a condition to emulate that? 

 

Something like {{ issue.fields.issuetype.customer <in> ("customer A", "Customer B", "Customer C") }}

Any idea?

1 answer

0 votes
Olap
Contributor
June 13, 2018

{% set trigger = false %}
{% for item in[{ title: "cust A"}, { title: "cust B"}, { title: "cust C"},{ title: "cust D"}] %}
{% if issue.fields["Customer"] == item.title %}
{% set trigger = true %}
{% endif %}
{% endfor %}
{{ trigger }}

Suggest an answer

Log in or Sign up to answer