I'm keep experiencing a problem where the if control statements do not function correctly.
I'm trying to complate a interger value from a fetchxml query but when doing so the value does not match the compared value.
{% fetchxml cases %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="incident">
<attribute name="statecode" />
<filter type="and">
<condition attribute="incidentid" operator="eq" uiname="XXXXXXXXX" uitype="incident" value="{{request.params['caseid']}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% if cases.results.entities.size > 0 %}{%assign caseobj = cases.results.entities[0]%}
{%assign contractname = caseobj.icas_contractnew.name%}
{%assign contractid = caseobj.icas_contractnew.id%}
{%assign case_status = caseobj.statecode%}
{%if case_status == 0%}
ACTIVE
{%else%}
INACTIVE
{%endif%}
{%endif%}
//////////////////////////
The code that is giving a problem is the following: {%if case_status == 0%} try as I might it does not recognise the 0 even though the output from the case_status is 0.
I've changed the assign code to {%assign case_status = caseobj.statecode|plus:0%} to force numeric but this also does not work.
Any advise would be great ?