Hi,
I'm looking for a way to kick off remote Jenkins builds from Jira. The idea is for the build to be triggered by a Jira workflow status transition. Is this possible? How best to go about it?
After rooting around here a few days I've gotten the idea hat a groovy script running in the ScriptRunner plugin and set up as a transition post-function might do the job. Will this work? Is there a better way?
I'm thinking the script would send a RESTful POST to Jenkins to kick off the build. It would have to get some data out of the issue (the one whose transition called it) first though, which I'm guessing would involve the Jira (java) API?
Just looking for some high-level guidance here, total Jira newbie.
thanks!
I know the thread is a bit outdated but maybe it can be useful to other people:
There is also a video on youtube showing how this works:
I hope this helps.
I believe that Jenkins has a REST API. If you can figure that part out, you can use JIRA webhooks (https://developer.atlassian.com/display/JIRADEV/JIRA+Webhooks+Overview) to trigger or call those REST API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, Webhooks would seem to be the answer. Unfortunately, HTTP Basic Auth is broken in Webhooks (has been since inception) so you can only do anonymous POSTs that way, which won't cut it in our environment. What I'm really looking for is a workaround to the broken Webhooks problem, ScriptRunner looks like a possibility but I'm not sure its the best one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Came across this looking for a solution to the same problem. What I did as a quick workaround was setup a flask application that accepts the Jira Webhook post, grabs the details of the ticket needed to run the Jenkins build, and sends a post to the Jenkins API to run the build. It works really well - I even have Jenkins sending back the build ID and periodic status updates as the build goes through the pipe line (readiness check, build, db updates, deployment, build complete).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.