在JIRA中,我们可以在更改状态的同时提供验证器。示例:打开->启动进度,将状态从打开更改为启动进度时,我们可以指定一个必填字段"comments“。因此,当用户将状态更改为启动进度时,JIRA将请求评论。现在我想在这个状态改变时获取这个验证器。那么有没有什么方法可以使用任何API来获取它呢?
发布于 2014-11-02 00:45:19
您应该能够执行以下操作:
/rest/api/2/issue/TEST-1234/transitions?expand=transitions.fields
它将显示可用于该问题的转换,并在每个转换中显示一个fields
部分,该部分将详细说明该字段是否为必填字段,例如:
timetracking: {
required: false,
schema: {
type: "timetracking",
system: "timetracking"
},
name: "Time Tracking",
operations: [
"set",
"edit"
]
}
或者:
resolution: {
required: true,
schema: {
type: "resolution",
system: "resolution"
},
name: "Resolution",
operations: [
"set"
],
allowedValues: [
{
self: "https://jira.atlassian.com/rest/api/2/resolution/1",
name: "Fixed",
id: "1"
},
...
{
self: "https://jira.atlassian.com/rest/api/2/resolution/18",
name: "Support Request",
id: "18"
}
]
}
https://stackoverflow.com/questions/26646324
复制