while making custom jql function can we display our own error below the search bar?

Ankit kharola November 19, 2024
  • while making custom jql function can we display our own error below the search bar?  if we wanted to let user know what is he doing wrong?

 

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

1 answer

1 accepted

0 votes
Answer accepted
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2024

Hi @Ankit kharola 

This seems more like a development issue.

I think you issue could be better answered by the Development Community

Ankit kharola November 20, 2024

Hi @Marc - Devoteam  Thank you for your response i have mentioned my issue there thank you for the response. also i am making a custom JQL function i wanted to know if  it's possible to display our own error below the JQLsearch bar. if users types something we are not expecting in our function to let the user know

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events