Hi,
There is a problem with permission to search by filter ID in JQL using Forge.
The same jql request filter in (34494) works successfully on a web page but doesn’t work in Forge app (see “Error from developer console” and “Code snippet” below).
In both cases, it has used the same user. Additionally, this user is the owner of the filter.
If replace const jqlString = ‘filter in (34494)’; to native jql string, for example, const jqlString = ‘project in (PKEY) AND “Quantile[Dropdown]” is not EMPTY’; requestJira gets a successful response and correct result.
Could somebody help to resolve the issue?
Code snippet:
resolver.define("getJiraIssuesByJQL", async ({ payload }) => {
const jqlString = 'filter in (34494)';
const jqlStringify = JSON.stringify(jqlString);
var bodyData = `{
"jql": ${jqlStringify},
"maxResults": 100,
"startAt": 0,
"fields": [
"summary",
"status",
"reporter"
]
}`;
const searchResponse = await api.asApp().requestJira(route`/rest/api/3/search`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json; charset=UTF-8'
},
body: bodyData
});
Error from developer console:
Error: API: POST search: 400 {"errorMessages":["A value with ID '34494' does not exist for the field 'filter'."],"warningMessages":[]}
Environment: Development
Trace ID: 0af6d8f16f8b454799ee363deeba8926-1c77dde9c0423906
Module: core:function
Function: resolver
Product: Jira