Webhook无法正常工作

时间:2016-06-09 11:28:35

标签: jira webhooks jira-rest-api jira-rest-java-api

我已经做了以下事情: 1)在JIRA创建了一个名为" Project1"并增加了工作流程" WF1"它。 2)创建了一个webhook" WB1"并将webhook作为后期功能添加到工作流程" WF1"。

现在我尝试从webhook" WB1"调用Java Rest API。 我的Rest API的网址是" http://PC93112.uk.rebushr.com:8080/JIRAIntegration/rest/JiraService/records" 任何帮助是极大的赞赏 现在问题是:我如何将问题密钥(已在JIRA中编辑过的问题)传递给我的Rest API。当我尝试下面的URL时,我得到文本“$ {issue.key}”而不是问题密钥。 http://PC93112.uk.rebushr.com:8080/JIRAIntegration/rest/JiraService/records?issue= $ {issue.key}

1 个答案:

答案 0 :(得分:1)

JIRA webhook documentation提到了这种限制,原因可能是:

  

如果您使用的是JIRA 5.2.2或更早版本,则在将JQL与webhooks一起使用时会出现一些已知问题:   当webhook用于工作流发布功能时,$ {issue.key}变量替换在webhook中不起作用。请注意,当问题事件触发webhook时,$ {issue.key}变量替换会起作用。

如果不是这样,您还可以将您的webhook配置为在其请求中包含一个正文,其中会提到有关受影响问题的信息,如下所示:

"issue": { 
    "expand":"renderedFields,names,schema,transitions,operations,editmeta,changelog",
    "id":"99291",
    "self":"https://jira.atlassian.com/rest/api/2/issue/99291",
    "key":"JRA-20002",
    "fields":{
        "summary":"I feel the need for speed",
        "created":"2009-12-16T23:46:10.612-0600",
        "description":"Make the issue nav load 10x faster",
        "labels":["UI", "dialogue", "move"],
        "priority": "Minor"
    }
}
相关问题