最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - How to query Jira Issues based on their custom field values? - Stack Overflow

programmeradmin1浏览0评论

I am working with Jira dotnet SDK. I have an issue type that contains a custom field which I need to query my issues based on the value of this custom field. for example all of my issues have 'RequesterId' and now I want to retrieve all of the issues those are requested by Id '123'.

I tried this code:

var issueQuery = from issue in _jiraClient.Issues.Queryable
            where issue.CustomFields.Any( x=>x.Name == "RequesterId" && x.Values.Contains(userId)) && issue.Project == _settings.ProjectKey
            select issue;

but this code throw this exception:

System.InvalidOperationException: Response Status Code: 400. Response Content: {"errorMessages":["Error in the JQL Query: Expecting a field name but got ')'. You must surround ')' in quotation marks to use it as a field name. (line 1, character 23)"],"errors":{}} at Atlassian.Jira.Remote.JiraRestClient.GetValidJsonFromResponse(IRestRequest request, IRestResponse response) at Atlassian.Jira.Remote.JiraRestClient.ExecuteRequestAsync(Method method, String resource, Object requestBody, CancellationToken token) at Atlassian.Jira.Remote.IssueService.GetIssuesFromJqlAsync(IssueSearchOptions options, CancellationToken token)

is there any standard to search in issues base on their custom field value?

发布评论

评论列表(0)

  1. 暂无评论