XPORTER: How to design a IF Condition with "unequal"

dD January 19, 2022

This might a really trivial question but I see no answer in the XPorter Documentation.

I use XPorter to export Values from linked issues like in this example:

 

#{for i = LinksCount|sortby=Key}

#{if (%{'${Links[i].Semester[10413]}'.equals('1')})}

${Links[i].Key}

#{end}

#{end}

The "equals" condition is very helpful but for some problems I need like the "unequals" condition. I didnt figured out how to do that.

 

e.g. in that exaple:

#{for i = LinksCount|sortby=Key}

 #{if (%{'${Links[i].Semester[10413]}'.equals('2')})}

#{if (%{'${Links[i].Prüfungsleistung[10411]}'.unequals('PA / Ref und Präsentation')})}

#{end}

#{end}

#{end}

I tried unequals and if not. Both didnt work, so I need your help with this.

 

Best thanks in advance!

1 answer

1 accepted

1 vote
Answer accepted
Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 19, 2022

Hi @dD 

Xporter uses Javascript when you have %{........} in the code.

So, all you need to use is the Javascript not operator ! (exclamation point) before the condition you want the evaluate the falsehood of the result, like this:

#{if (%{!'${Links[i].Prüfungsleistung[10411]}'.equals('PA / Ref und Präsentation')})}

What this condition evaluates is if the result is not equal to 'PA / Ref und Präsentation', since the operation unequal does not exist in Javascript.

Thank you.

Kind regards,
Rogerio Paiva [Xporter Support Team]

dD January 19, 2022

Best thanks to you @Rogério Paiva - Xray Xporter !!!

This works perfect and your answer came just in the right time. Also I learned a little about javascript.

Thank you so much and have a nice evening.

BEST

Daniel

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events