How to get Application id from UUID

Hi Community,

I am trying to create a WEB API to run a test for an application following this link. The following is the code which uses a constant to start rule test application APPLICATION_TO_TEST.

a!startRuleTestsApplications(
   applications: cons!APPLICATIONS_TO_TEST,
   onSuccess: a!httpResponse(
    statusCode: 200,
      body: fv!testRunId
  ),
  onError: a!httpResponse(
    statusCode: 500,
    body: concat("Error message: " , fv!error)
  )
)

It works fine but it means the API only works for a specific application and it is not possible to inject application. So I would like to change it to the following:

a!startRuleTestsApplications(
   applications: http!request.queryParameters.id,
   onSuccess: a!httpResponse(
    statusCode: 200,
      body: fv!testRunId
  ),
  onError: a!httpResponse(
    statusCode: 500,
    body: concat("Error message: " , fv!error)
  )
)

The problem is the function (startRuleTestsApplications) accepts the list of applications which is environment-specific (it is application id) so somehow I need to pass Application UUID and inside the WEB API code convert it to Application id

Question is: is there any function or plugin in APPIAN which accepts UID and return application id?

Regards,

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data