can't use IF in a nunjucks template?

Jason Coan September 7, 2017

 

I'm using JMWE to create a linked issue during a transition, and then assign the new linked issue to the appropirate person using a nunjuck template to do some simple logic....well, at least that's what I want to do.  For example:

If ValueA > 1 then assignee = Bob

if valueA > 10 then assignee = Doug

I can get JMWE to create the linked issue, no problem there.  Using a nunjucks template to set the Assignee field to currentUser.name works just fine.

But if I try to use an If/then in the nunjucks, it doesn't create the linked issue.  After some experimentation, I've discovered that something as simple as "if 1>0 then" doesn't work.  It works when I test the nunjucks template, but it doesn't work when I try to transition an issue, nothing happens, no issue is created.

{% if 1>0 %}

{{ currentUser.name }}

{% endif %}

Any ideas or suggestions on how else I could accomplish something like this?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events