查找用户参与服务台的所有请求

时间:2018-10-19 05:12:06

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

在JIRA中,如何获得参与方的所有问题? 我可以得到受让人和记者的结果。

当用户是记者时,我正在使用以下查询来获取问题。

  

报告者=用户并已更新> -10d

我仅需要显示参与者(而不是报告者或受让人)的问题。如何在搜索API中实现这一目标?

1 个答案:

答案 0 :(得分:0)

如果您希望使用Jira的搜索API,并且正在寻找用户所参与的问题,请尝试将其添加到JQL "Request participants" in (currentUser())中。

由于您担心Jira Service Desk(JSD),因此您可能要尝试以下JSD特定的REST API,具体取决于您正在使用的部署:

  • 服务器:Get my customer requests,然后传递 requestOwnership 查询参数,其值为 PARTICIPATED_REQUESTS
  • 云:Get customer requests然后传递 requestOwnership 查询参数,其值为 PARTICIPATED_REQUESTS

编辑:(添加了代码段)

app.get('/getMyRequests', addon.checkValidToken(), function(req, res) {
var httpClient = addon.httpClient(req).asUserByAccountId("myAccountId");

httpClient.get({
    url: '/rest/servicedeskapi/request',
    headers: {
        'X-Atlassian-Token': 'nocheck',
        'Content-Type': 'application/json'
    }
},
function (err, httpResponse, body) {
    if (err) {
        return console.error('failed:', err);
    }
    console.log('successful:', body);
});});