i am trying to learn forge i was trying to create a custom function witn two args first is jql and second is name or id and the jql user types i am trying to validate it through the jql parse rest api
const validateJQLQueries = async (queries) => {
const bodyData = JSON.stringify({
queries: [queries]
});
const response = await api.asUser().requestJira(route`/rest/api/3/jql/parse?validation=true`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: bodyData
});
console.log(response, "res")
const result = await response.json();
console.log(result, "check my result");
if (response.ok) {
return { valid: true, results: result };
} else {
console.error('Validation failed:', result);
return { valid: false, errors: result.errors || [] };
}
}; when i pass project=xyz it validates it correctly but i i type assignee=curretUser() it gives error for this and also if i try to combine two queries using AND OR it wont validate it and give error