I’ve successfully set up the plugin Jenkins - Queue Job as the last step being triggered from our deployment to QA. However, an exception is thrown complaining about failed connection to the remote server. This might have something to do with the fact that our Octopus and Jenkins servers are on separate environments (IP space).
I’ve also tried running the code snippet directly from my machine via PowerShell, with a few modifications.
I ended up with an exception that included a 403 Forbidden status code.
Should the Job URL link be using http or https? Could that be the reason for my failed attempts?
I’m using my own username and password to authenticate to the servers, not any provided global users, could that have some affect?
Any other ideas on what I could do to troubleshoot?
The 403 response code you have received indicates that the credentials you have supplied to Jenkins are invalid, or that you have not included the correct crumb in the request.
This will result in a Jenkins project being deployed.
When troubleshooting REST API calls to Jenkins it is useful to make the calls in a tool like Postman (https://www.getpostman.com/), because you can see the response text which will often indicate the underlying issue for a failed request. For example, in the screenshot below you can see a request that failed because of a missing crumb value.