I have been struggling with this since last week and have tried different methods to solve this.
ProjectNumber in my RSD is defined as string but still when i get 123ProjectNumber456 as projectnumber i get an error
2025-01-24T15:27:32.136+01:00 3 [153|Q-Id] [HTTP|Res: 1924] {"description":"Budgettype 'approved' does not exist for projectnumber '123ProjectNumber546'"}
2025-01-24T15:27:32.136+01:00 2 [153|Q-Id] [HTTP|Res: 1924] HTTP/1.1 404 Not Found, 107 Bytes Transferred
2025-01-24T15:27:32.136+01:00 2 [153|Q-Id] [HTTP|Res: 1924] Error: HTTP protocol error. 404 Not Found. Stack: at dwo230y.w.De(String )
I have tried sorting out the given project with this code but it didnt work
<api:if condition="[touchIn.cleanedProjectNumber | contains('123ProjectNumber456')]">
</api:if>
<api:else>
<!-- Set revisionType when condition is true -->
<api:set attr="detailsIn.revisionType" value="approved"/>
I have also tried the follwing but its not working
<api:if condition="[touchIn.cleanedProjectNumber | eq('123ProjectNumber345') | not()]">
<!-- Set revisionType when condition is true -->
<api:set attr="detailsIn.revisionType" value="approved"/>
Any suggestions:
<api:script method="GET">
<api:call op="jsonproviderGet" in="touchIn" out="touchOut">
<!-- Remove all blank spaces from projectNumber and store in a variable 'cleanedProjectNumber' -->
<api:set attr="touchin.cleanedProjectNumber"
value="[touchOut.projectNumber | trim()]" />
<!-- Use the variable cleanedProjectNumber' in the URI -->
<api:set attr="detailsIn.URI"
value="[detailsIn.URITemplate | replace('{projectNumber}', [touchin.cleanedProjectNumber])]" />
<!-- Get only 'aproved' budgets -->
<api:set attr="detailsIn.revisionType" value="approved"/>
<api:call op="jsonproviderGet" in="detailsIn" out="detailsOut">
<api:set attr="out.projectNumber" value="[touchOut.projectNumber | allownull()]"/>
<api:set attr="out.description" value="[detailsOut.description | allownull()]"/>
<api:push item=out/>
</api:call>
</api:call>
</api:script>
</api:script>