Forums

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

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

Gene Smilgiewicz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2015

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

 

6 answers

2 votes
Fábio Antunes
Contributor
July 23, 2015

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 

2 votes
Fábio Antunes
Contributor
July 21, 2015

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 

0 votes
Yanet Morales
Contributor
June 16, 2020

Hi, I tried to create an Or condition in an if statement but it's not working and in the documentation I can't find a proper example. I need to know what is the proper sintax for that. Could anyone help me, please?

0 votes
Filip Tanevski September 11, 2019

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?

0 votes
Iagh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 13, 2019

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

0 votes
Gene Smilgiewicz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 22, 2015

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

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events