我试图使用Jenkins和Jira Trigger插件为Jenkins设置一些自动化。我已经在Jira端建立了一个Web钩子,它可以根据需要在Jenkins上调用构建。Jenkins的Jira Trigger插件:从问题对象中获取价值
我从收到的Jira请求获取自定义字段的值时遇到了问题。
我试图用“问题属性路径”功能,并且我也被称为后(How to use the 'Issue attribute path' in the parameter mapping of jenkins-trigger-plugin)
Howevevr我仍然无法获得自定义字段customfield_10010
,customfield_10011
值。我已尝试使用像fields.customfield_10010
,fields.customfield_10010.value
,fields.customfield_10010.0.value
,customfield_10010.0.value
和类似组合的映射。我可以像插件帮助中所建议的那样获得其他标准字段的值。例如:status.name
,description
等
我也无法从Jira documentation site得到任何线索。
传入的json数据的一部分在下面,以便于参考。
"issue": {
"id": "1000x",
"self": "http://localhost:3080/rest/api/2/issue/10007",
"key": "ABC-2",
"fields": {
"issuetype": {
..
},
"parent": {
..
},
"components": [
],
"timespent": null,
"timeoriginalestimate": 28800,
"description": ".....",
"project": {
..
},
"customfield_10010": [
{
"self": "http://localhost:3080/rest/api/2/customFieldOption/10019",
"value": "ABC-Custom 1",
"id": "10019"
}
],
"fixVersions": [
],
"customfield_10011": [
{
"self": "http://localhost:3080/rest/api/2/customFieldOption/10021",
"value": "ABC-Custom 2",
"id": "10021"
}
],
.....
....
....
}
}
这是不是一个已实现的功能。参见:[JENKINS-38797](https://issues.jenkins-ci.org/browse/JENKINS-38797) – ceilfors