Getting "There are no scripts to configure this policy." when trying to add a new JS policy

I am trying to add a new javascript policy and create a new script, but the modal won't get past the error below.

2428-capture.png

1 12 260
12 REPLIES 12

@coolidm , Are you on cloud / onPrem ? What is the version number of Apigee Edge ? You can find version by navigating to https://enterprise.apigee.com/buildInfo

We are on the latest onPrem.

I just tried this on my Edge On-Premises installation. It uses 16.01.

I have no problems. It added a new script as expected.

@coolidm , Can you please confirm version of opdk by navigating to https://yourmanagementui/buildInfo ?

Hi @coolidm You are using a script named "Filter-Elements.js". Does that script exists? If not you have to create that script. Scroll down a bit more on left hand side and you will an option for scripts and to add a new one.

@sarthak , Create New Script should create a script automatically instead of manually adding same using scripts option in proxy editor screen. It works as expected in cloud why not onprem ? Seems like it's a bug to me.

@coolidm , For now you can use below workaround, till we fix above issue

1. Use script add option in proxy editor to add a javascript. See attached screenshot for reference.

2429-script-manual.png

2. Add any policy & then replace policy xml with below code,

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Javascript async="false" continueOnError="false" enabled="true" timeLimit="200" name="Filter-Elements">
    <DisplayName>Filter Elements</DisplayName>
    <Properties/>
    <ResourceURL>jsc://Filter-Elements.js</ResourceURL>
</Javascript>

Let us know if above workaround works for you / if any queries.

I was able to get around it by adding the file first then selecting that script to create the policy, but my expectation would be for that step to add a new file with the provided name.

@coolidm , Completely agree with you. Cloud Edge just works like you mentioned. Seems like a bug to me. Let me follow up with opdk team.

@coolidm

The behavior that you mentioned that's the default one. You need to create the script file first and then you can refer that file in java script policy. It doesn't seem a bug to me.

This issue is not present on cloud. I am able to add new script while adding the policy.

I was able to get around it by adding the file first then selecting that script to create the policy, but my expectation would be for that step to add a new file with the provided name.