Call the Jenkins REST API from Octopus PowerShell Script

I want to build a job in jenkins after Octopus deployment completed. I followed the following https://octopus.com/blog/jenkins-rest-api but got the following

I am using Jenkins 2.249.1 version and Octopus 2019.13.7.

Hi @endashaw.adane,

Thanks for getting in touch! I’m sorry to hear you’re hitting this roadblock. This error message looks to be coming from Jenkins, and admittedly I haven’t come across this one before.

After some digging, I think it might be this known and current issue in Jenkins (reference issue here), and I saw users get around this by ticking the Enable proxy compatibility checkbox in the CSRF Protection section (shown in the first screenshot in the blog post you linked to).

Something else possibly relevant is this Stack Overflow thread, where one answer is: “To resolve this issue I unchecked "Prevent Cross Site Request Forgery exploits" in jenkins.com/configureSecurity section and it started working”.

I hope this helps unblock you! Please let us know how you go. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.