Warm tip: This article is reproduced from serverfault.com, please click

how to trigger a Jenkins job from an approval of a Jira task

发布于 2020-11-30 07:07:02

I'm looking for a method to trigger remote Jenkins job based on Jira workflow status. The idea is to create a Jenkins job which is to be triggered based on Project Manager's approval. When task gets approval status then Jenkins should trigger the job in project. Please help me on this.

Note: I have created a webhook in Jira and configured required plugins in Jenkins.

Questioner
prabha vk
Viewed
0
np2807 2020-11-30 23:04:48

If I Understood correctly the question, you want to trigger the Jenkins Job when the Jira Item(task/ticket) is in particular state(e.g. Approved, In-progress).

You possibly need to have following Plugins:

  1. JIRA
  2. JIRA Pipeline Steps
  3. JIRA Trigger Plugin
  4. JIRA ext-plugin

Before creating a job which will triggered based on Jira Item status, you need to have JIRA webhook integration.

enter image description here

The KEY* is the TICKET PATTERN required to integrate with Jenkins. Please find a link which explains a simple use case in here

While creating jenkins job, you will get under category 'Build Trigger' additional option 'Build when issue is updated in JIRA'. After this be keen to update JQL Filter as per your need.