Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Say that you have an existing snippet that you tested in curl like:

to make that work with the rest plugin, choose the operation that matches the HTTP method that you used with curl.

copy the URL. You can use groovy to convert https://bitbucket.com/projects/DEV/repos/ebs/pull-requests/72/mere?version=0

to “https://bitbucket.com/projects/DEV/repos/ebs/pull-requests/” + PR_ID + “/mere?version=0

Now you can pass the pull request ID into the operation.

The headers come from -H (--header) and go into the headers box.

Three double quotes will allow for multiline strings in groovy.

The -d (--data) goes to the body. If you used a body path, it goes there instead.

Fill in the body media type appropriately (if post/put/patch)

The response is available to the workflow at the bottom.

Create workflow variables and reference them here.

If you are expecting to receive json or xml back, you may want to parse it and make decisions on it.

If so, use the parseJson or parseXml operations to do so.

Again, you would want to create a workflow variable to get the data from the operation that you are on into the workflow, and then use it in the next.

  • No labels