Hi,
I'm trying to make multiple requests over automation to a Web Service (API) when a new release is released.
So, I'm defining some parameters over the release description (such as "Services: jst-core-service(v2.0.0);jst-xpto-service(v2.1.2);jst-whatever-service(v1.9.9)") and then I extract the release description and try to create a branch from a smart value variable.
I don't know why but it isn't working, could anyone help me?
As you can see, the Advanced Branching isn't working well.
Hi @Felipe Bonezi --
So the trick is that Variables outside of Branches don't always work so well. I got your regexes to work by making one small change. I put the first one directly into the Advanced Branching block:
Once I made that change I was able to create variables inside the branch just fine and echo them out to the audit log, so they should also work fine in your Web Request:
Please let us know if this resolves the issue!
Oops, and because I wasn't careful in my typing, I forgot the ": " after "Services", which is what resulted in that extra one before the first repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee it worked in a way.
The Smart Values are creating right but the request isn't working.
It returns 404 Not Found, so I believe that {{repository}} used as request path isn't working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The other problem is when you use the same version value.
Try to use every service with `v2.0.0`.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee I fixed using smart value as the full url.
But right now the body custom data isn't working... It returns 500 Internal Server Error and it's related to an invalid JSON body.
If I use into Postman, works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Again, I would advise against using "Create variable" to create your {{githubBody}} an {{githubUrl}} because as mentioned before, variables are a little... unreliable, having to do with what order Automation runs stuff in, etc etc.
Instead, I would do what you did before, putting the URL directly into the Web Request to github with the {{respository.urlEncode()}} variable added, and similarly, the put the {{versionName.urlEncode()}} directly in the Custom data of the Web Request.
I know variables are the "right way" or "cleaner way" to do things. But they don't reliably work in Automation, so sometimes it's best to put the smart values directly into the actions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, I did have one thought - can you post a screenshot of what was actually in {{githubBody}}? Did you include the braces and everything so that it generated something like:
{"tag_name":"v1.0.0", "target_commitish":"master", "name":"v1.0.0", "body":"Description of the release", "draft":false, "prerelease":false, "generate_release_notes":true}
It's always helpful to output to the Audit Log what the content of that variable might look like.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And you also tried *without* using an intermediary variable?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, if I don’t use {{githubUrl}} it doesn’t work. Even if I use the full endpoint as string, it doesn’t work.
is there any way to log the hole request?
if I copy and paste the same content into Postman, works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee it worked doing everything inside the Send Web Request.
It's very painful to work creating variables as you said.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad it worked. Yeah, it's a bummers variables don't work more reliably.
Note there's a minor typo in your headers. Should be Content-Type, I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.