JiraJira

需要 用户名 (用于登录) 和 API 令牌 以连接到 Jira 的电子邮件地址。You need a Username (the email address you use to login) and API Token to connect to Jira. 令牌的行为类似于密码。The token behaves like a password.

Jira 数据源Jira data source

查询Query

对于简单查询,返回无筛选的问题:For a simple query, one that returns issues with no filtering:

{}

仅返回特定字段:Return only specific fields:

{
  "fields": "summary,priority"
}

仅返回特定字段并按优先级筛选:Return only specific fields and filter by priority:

{
  "fields": "summary,priority",
  "jql": "priority=medium"
}

计算的问题数 priority=mediumCount number of issues with priority=medium:

{
  "queryType": "count",
  "jql": "priority=medium"
}

您还可以使用字段映射为结果重命名字段,这在使用自定义字段时非常有用:You can also use the field mapping to rename a field for the result - this is useful when working with custom fields:

{
  "fields": "summary,priority,customfield_10672",
  "jql": "priority=medium",
  "fieldMapping": {
    "customfield_10672": "my_custom_field_name"
  }
}

JIRA 返回的某些字段是具有多个属性的 JSON 对象。Some fields returned by JIRA are JSON objects with multiple properties. 您可以定义一个字段映射,以选择要返回的特定成员属性 (在此示例中,"priority" 字段) :You can define a field mapping to pick a specific member property you want to return (in this example ‘id’ member of the ‘priority’ field):

{
  "fields": "summary,priority",
  "jql": "priority=medium",
  "fieldMapping": {
    "priority.id": "priority"
  }
}

下面是一个更复杂的示例,该示例合并了不同的筛选器选项:Here’s a more complex example combining the different filter options:

{
  "fields": "summary,priority,customfield_10672,resolutiondate,fixVersions,watches,labels",
  "jql": "project = MYPROJ AND resolution = unresolved ORDER BY priority DESC, key ASC",
  "maxResults": 30,
  "fieldMapping": {
    "customfield_10672": "my_custom_field_name",
    "priority.id": "priority",
    "fixVersions.name": "my_fix_version",
    "fixVersions.id": "my_fix_version_id"
  }
}

如果字段包含值的列表,则返回与 "," 串联的所有值。If a field contains a list of values all are returned concatenated with “,”.