Code Monkey home page Code Monkey logo

jira-trigger-plugin's Introduction

JIRA Trigger Plugin

Build Status Java 1.7.0_79

This plugin is published through the Jenkins official plugin center.

Features

  • 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

This plugin has been tested against JIRA 7.0.0, although theoretically it should work with older version of JIRA as long as it supports the webhook type required (see Setup section below).

Check src/test/groovy/*AcceptanceTest to see how these features are expected to behave.

Getting help

Setup

Add new JIRA webhook (One time)

  1. Go to JIRA > Cog > System > Advanced > WebHooks (Requires admin permission)
  2. Create a new Webhook
  3. Set URL to: ${Jenkins URL}/jira-trigger-webhook-receiver/ e.g. http://localhost:8080/jenkins/jira-trigger-webhook-receiver/
  4. Set Events to: issue updated
  5. Do not check Exclude body as this plugin requires the JSON to operate
  6. Save!

To troubleshoot:

  1. Enable Jenkins logging at FINE level for troubleshooting: com.ceilfors.jenkins.plugins.jiratrigger.webhook
  2. You should see "Received Webhook callback ..." log messages when Jenkins is receiving webhook events

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

Job configuration

New triggers will be made available after you have successfully install this plugin from Jenkins plugin center. More in depth documentation about how you can configure the job are documented in the help files. Be sure to hit those question mark buttons in Jenkins configuration page!

The configuration of Pipeline jobs are located in the job configuration page as well and not the Jenkinsfile, as per the screenshot shown below. The new triggers will come up next to the "Build periodically" trigger.

If you are creating a new Pipeline job, you'll have to reconfigure the job and save it again before the job can be triggered properly. This is currently a known issue.

Comment trigger

Comment Trigger Configuration

Changelog trigger

Changelog Trigger Configuration

Environment variables

JIRA Trigger Plugin sets environment variables you can use during the build:

  • JIRA_ISSUE_KEY - The JIRA issue key that triggers the build

Troubleshooting

Enable logging

Enable Jenkins logging for package: com.ceilfors.jenkins.plugins.jiratrigger. If nothing comes out in the log, it is possible that your JIRA instance is unable to hit your Jenkins instance due to network connectivity issue.

Building Project

To build, run acceptance test, and release commands, refer to this document

jira-trigger-plugin's People

Contributors

ceilfors avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.