can't use IF in a nunjucks template?

 

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

173 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you