It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to do ".notequals", ".or", "else" conditions in Xporter?

I have a custom field that's a select list with "Yes" and "No" options for values. This works:

#{if (%{'${elmYnMigration}'.equals('Yes')})}
... show this content ...
#{end}

How does one do a "not equals" version?

Piling on... is there an "or" construct?  What about an "else"?

Thanks in advance for any feedback...

-Gene

 

5 answers

Hi @Gene Smilgiewicz

Currently Xporter for JIRA does not have an "else" statement, but you could use another if as workaround, example:

#{if (%{'${elmYnMigration}'==='Yes'})}
... show this content ...
#{end}
#{if (%{!'${elmYnMigration}'==='Yes'})}
... show other content ...
#{end}

Kind Regards,
Fábio Antunes 

Hi @Gene Smilgiewicz

Please try the following code:

#{if (%{'${elmYnMigration}'==='Yes'})}
…Show Content Here…
#{end}
#{if (%{!('${elmYnMigration}'==='Yes') || !${elmYnMigration}})}
…Show Other Content Here…
#{end}

What is the version of Xporter for JIRA that you're using ?

Kind Regards,
Fábio Antunes 

Thanks for chiming in, Fábio.

Without an #{else} I was forced to stack #{if} statements... an #{or} would be helpful.

BTW, your suggestion for not equals (#{if (%{!'${elmYnMigration}'==='Yes'})}) did not work for me.  Interesting variation of the Xporter syntax there.  

-Gene

 

#{if (%{'${elmYnMigration}'!='Yes'})} works for me

I have the same issue when it comes to filtering certain link types from an issue.

#{for tests}

#{for a=Tests[n].LinksCount}

#{if (%{'${Tests[n].Links[a].LinkType}'.equals('tests')})}

${Tests[n].Key}

#{end}

#{end}

#{end}

 I need an IF to get my all links except the TESTS one. I tried:

#{if (%{!'${Tests[n].Links[a].LinkType}'.equals('tests')})}
#{if (%!{'${Tests[n].Links[a].LinkType}'.equals('tests')})}

#{if (!%{'${Tests[n].Links[a].LinkType}'.equals('tests')})}
 #{if !(%{'${Tests[n].Links[a].LinkType}'.equals('tests')})}

 None of those work.

Any idea?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

303 views 1 3
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you