Requesting field config results in INVALID_TARGET_URL error

Hi @BrianPham, my first guess is that the path parameters might not be correct for the API request that you are attempting to make. Where are you getting the params for mysite and myrepo in /2.0/repositories/<mysite>/<myrepo>?

mysite should be your Bitbucket workspaceId and myrepo should be your repositoryId. You should be extracting them like this:

resolver.define("fetchRepository", async ({ context }) => {
  const workspaceId = context.workspaceId;
  const repositoryId = context.extension.repository.uuid;

  // Base should be constructed using workspaceId and repoId from the context passed to your resolver
  const base = `/2.0/repositories/${workspaceId}/${repositoryId}`;
  //.... other application specific logic ...
});

Let me know if this isn’t the issue. If not, can you please provide me with your appId and create another thread to make sure this thread doesn’t deviate. Thanks!

1 Like