Project Icon

jira-plugin

Jenkins与Atlassian Jira集成插件

jira-plugin是一款Jenkins插件,用于集成Atlassian Jira软件的云端和服务器版本。它能自动链接构建日志中的Jira问题、更新Jira问题状态、引用Jira版本信息及生成发布说明。此插件旨在提升开发团队工作效率,促进Jenkins和Jira系统间的协作。插件的主要功能包括自动链接Jira问题、更新问题状态、引用版本信息和生成发布说明。它支持Jira云端和服务器版本,适用于各种规模的开发团队。通过简化Jenkins和Jira之间的信息交互,该插件有助于提高项目管理和开发流程的效率。

Jenkins Jira Plugin

Documentation Jenkins Plugin Installs GitHub release Jenkins CI Contributors

About the plugin

This plugin integrates with Jenkins the Atlassian Jira Software (both Cloud and Server versions). For bug reports, see bugs or all open issues. For documentation, see official plugin site.

Compatibility

For plugin compatibility with Pipeline plugin, see COMPATIBILITY.

Configuring the plugin

Configuration for Jira Cloud

With Atlassian Jira Cloud, it's not possible to create a user without an email, so you need to create API token that will be used as a service user by Jenkins to execute API calls to Jira Cloud - follow Atlassian API tokens documentation

Then create a global Jenkins credential:

  • put Atlassian ID email as username
  • API token as password.

You can check if your API token works correctly by getting a correct JSON issue response with this command (where TEST-1 is an example issue in your project):

curl -X GET -u <email>:<API token> -H "Content-Type: application/json"  https://<YourCloudInstanceName>.atlassian.net/rest/api/latest/issue/TEST-1

Also make sure that CAPTCHA is not triggered for your user as this will prevent the API token to work - see CAPTCHA section in Atlassian REST API documentation.

System properties

  • -Dhudson.plugins.jira.JiraMailAddressResolver.disabled=true

    Use to disable resolving user email from Jira usernames. Currently there is no option for this in UI.

Using Jira REST API

This plugin has an optional feature to update Jira issues with a back pointer to Jenkins build pages. This allows the submitter and watchers to quickly find out which build they need to pick up to get the fix.

plugin-configuration

Jira Issue links in build Changelog

When you configure your Jira site in Jenkins, the plugin will automatically hyperlink all matching issue names to Jira.

If you have additionally provided username/password to Jira, the hyperlinks will also contain tooltips with the issue summary.

example-annotated-changelog

Updating Jira issues with back pointers

If you also want to use this feature, you need to supply a valid user id/password. If you need the comment only to be visible to a certain Jira group, e.g. Software Development, enter the groupname.

Now you also need to configure jobs. I figured you might not always have write access to the Jira (say you have a Jenkins build for one of the Apache commons project that you depend on), so that's why this is optional.

The following screen shows how a Jira issue is updated:

jira-comments

By taking advantages of Jenkins' fingerprint feature, when your other projects that depend on this project pick up a build with a fix, those build numbers can also be recorded in Jira.

This is quite handy when a bug is fixed in one of the libraries, yet the submitter wants a fix in a different project. This happens often in my work, where a bug is reported against JAX-WS but the fix is in JAXB.

For curious mind, see this thread for how this works behind the scene.

Referencing Jira Release version

To reference Jira Release versions in your build, you can pull these releases directly from Jira by adding the Jira Release Version Parameter.

This can be useful for generating release notes, trigerring parameterized build, etc.
version-parameters

Generating Release Notes

You can also generate release notes to be used during your build. These notes can be retrieved from an environment variable. See the Maven Project Plugin for the environment variables found within the POM.
release-notes

After your build has run, you can also have the plugin mark a release as resolved. This typically will be a release you specified in your Build Parameters.
marking-as-resolved

The plugin can also move certain issues matching a JQL query to a new release version.
moving-issues

Sample usage of generated Release Notes: release-notes-config

Jira Authentication & Permissions required

Note: As a rule of thumb, you should be always using a service account (instead of a personal account) to integrate Jenkins with Jira.

Make sure that the Jira user used by Jenkins has enough permissions to execute its actions. You can do that via Jira Permission Helper tool.

  • For creating Jira issues, the user has to be able to Create Issues in the specified project
  • If you additionally enter assignee or component field values, make sure that: - both of the fields are assigned to the corresponding Jira Screen - the Jira user is Assignable in the project - the Jenkins Jira user can Assign issues

Related Resources

Common issues

Jenkins<>Jira SSL connectivity problems

If you encounter stacktrace like this:

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

make sure the JRE/JDK that Jenkins master is running (or the Jenkins slaves are running) contain the valid CA chain certificates that Jira is running with. You can test it using this SSLPoke.java class:

$ wget -O SSLPoke.java https://gist.githubusercontent.com/warden/e4ef13ea60f24d458405613be4ddbc51/raw/7f258a30be4ddea7b67239b40ae305f6a2e98e0a/SSLPoke.java

$ /usr/java/jdk1.8.0_131/bin/javac SSLPoke.java

$ /usr/java/jdk1.8.0_131/jre/bin/java SSLPoke jira.domain.com 443
Successfully connected

References:

Something doesn't work?

Contribute or Sponsor!

We all love Open Source, but... Open Source Software relies on contributions of fellow developers. Please contribute by opening Pull Requests or if you are not a developer, consider sponsoring one of the maintainers.

Contributing

New feature proposals and bug fix proposals should be submitted as Pull Requests. When adding new features please make sure that they support Jenkins Pipeline Plugin - see COMPATIBILITY.md for more information

Tests

There have been many developers involved in the development of this plugin and there are many downstream users who depend on it. Tests help us assure that we're delivering a reliable plugin and that we've communicated our intent to other developers in a way that they can detect when they run tests.

  • each change should be covered by appropriate unit tests.
  • in case it is not testable via a unit test, it should be tested against a real Jira instance - possibly both Jira Server and Jira Cloud. There is a Jira Cloud test instance that we are using for testing the plugin releases - let us know in the Pull Request in case you need access for testing.

Maintainers

See MAINTAINERS for some useful info.

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

问小白

问小白是一个基于 DeepSeek R1 模型的智能对话平台,专为用户提供高效、贴心的对话体验。实时在线,支持深度思考和联网搜索。免费不限次数,帮用户写作、创作、分析和规划,各种任务随时完成!

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

Trae

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号