简体   繁体   English

发布时将JIRA变量传递给Bamboo

[英]Pass JIRA variables to Bamboo on release

We have JIRA, BitBucket and Bamboo, all integrated running locally on a server. 我们有JIRA,BitBucket和Bamboo,它们都在服务器上本地运行集成。 I would like to have Bamboo build my software when I decide to release it in JIRA. 当我决定在JIRA中发布软件时,我希望Bamboo来构建我的软件。

There is a document available at Atlassian that describes this: Atlassian上有一份文档对此进行了描述:

https://confluence.atlassian.com/jirasoftwarecloud/running-a-bamboo-build-when-releasing-a-version-764478184.html https://confluence.atlassian.com/jirasoftwarecloud/running-a-bamboo-build-when-releasing-a-version-764478184.html

The problem is that my interface doesn't have the Build Variables as described in the documentation. 问题是我的界面没有文档中所述的构建变量 This is crucial, because I want JIRA to pass the version number and Bamboo to use that as a variable for different tasks. 这很关键,因为我希望JIRA传递版本号,而Bamboo希望将Bamboo用作不同任务的变量。

Here is a screenshot of the interface: 这是界面的屏幕截图: JIRA发布UI

I realise that the docs are for JIRA cloud, but seeing that the same interface is available on the server edition, I would expect to be able to accomplish the same thing. 我意识到这些文档适用于JIRA云,但是看到服务器版本上提供了相同的界面,我希望能够完成相同的事情。

We use JIRA version 7.9.2 and Bamboo version 6.5.1 我们使用JIRA版本7.9.2和Bamboo版本6.5.1

Does anyone know why the Build Variables might be missing, or how else to tackle passing variables from JIRA to Bamboo in a self-hosted situation? 有谁知道为什么可能缺少构建变量,或者在自托管情况下如何解决将变量从JIRA传递到Bamboo的问题?

I worked around this by using the "Dump variables to log" job to check what variables are available. 我通过使用“将变量转储到日志”作业来检查可用变量来解决此问题。 As it turns out the JIRA version is available when a build is triggered through the JIRA "release" button. 事实证明,当通过JIRA“发布”按钮触发构建时,JIRA版本可用。

The variable I could use is bamboo.jira.version . 我可以使用的变量是bamboo.jira.version

This doesn't solve the actual problem of defining arbitrary variables in JIRA and passing them on to Bamboo, but it solves the problem in my use-case, as I was looking to pass the release version. 这并不能解决在JIRA中定义任意变量并将其传递给Bamboo的实际问题,但可以解决我的用例中的问题,因为我一直希望通过发行版。

Update : 更新

I have an offical answer form Atlassian regarding this question. 关于这个问题,我有一份Atlassian正式回答表格。

I was under the impression that the custom variables you want to pass are defined on the release screen in JIRA itself. 我的印象是,要传递的自定义变量是在JIRA本身的发布屏幕上定义的。

As it turns out, variables are defined on the plan or global level in Bamboo , and they can then be used/overridden on the release screen in JIRA. 事实证明,变量是在Bamboo上的计划全局级别上定义的,然后可以在JIRA的发布屏幕中使用/覆盖它们。

It works now! 现在可以使用! 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM