JIRA Trigger Plugin功能

  • Triggers a build when a comment is added to JIRA
  • Triggers a build when an issue is updated in JIRA
  • Transforms JIRA Webhook POST data to Jenkins parameters
  • Transforms JIRA standard custom fields to Jenkins parameters (See CustomFieldParameterResolverTest for the full list of supported custom field types)
  • Reply back to JIRA for scheduled builds
  • Sets JIRA information as environment variables to the triggered build

Jenkens上安装插件: JIRA Trigger Plugin

插件地址:https://github.com/jenkinsci/jira-trigger-plugin

配置

JIRA 配置

Add new JIRA webhook (One time)

  1. Go to JIRA Administration> System > WebHooks (Requires admin permission)
  2. Create a new Webhook: Set URL to: ${Jenkins
    URL}/jira-trigger-webhook-receiver/ e.g.
    http://localhost:8080/jenkins/jira-trigger-webhook-receiver/
  3. Enable issue updated event
  4. If you are on JIRA Cloud, enable comment created event
  5. Do not check Exclude body as this plugin requires the JSON to operate
  6. Save!
    JIRA webhook里必须要选择一个触发实践,如果没选择任何触发事件,则不能触发。
    在这里插入图片描述

Jenkins 配置

Jenkins global configuration (One time)
This configuration is crucial, especially for JQL filter usage.

  1. Go to Jenkins global configuration (${Jenkins URL}/configure)
  2. Configure JIRA Trigger Configuration
    在这里插入图片描述

Jenkins Job 配置

Comment trigger

JIRA里录入的comment要与这里的Comment pattern匹配才能触发job
在这里插入图片描述

Changelog trigger

在这里插入图片描述
Demo
在JIRA的DEV项目的一个user story输入Please build me就会触发jenkins job,我这里同时触发2个jenkins job
在这里插入图片描述
在这里插入图片描述

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐