Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to validation jql clause in java class?

Dang Thi Thuy Tien
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.
February 12, 2019

I want to validation  jql clause in java class.

Some thing like: I have a string "project = 10000" 

I want to check it valid or invalid  /( correct or uncorrect)  jql.

How can I do that?

 

Thanks,

1 answer

1 accepted

1 vote
Answer accepted
Dang Thi Thuy Tien
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.
February 12, 2019

I found script to validation JQL:

ApplicationUser user = jiraAuthenticationContext.getLoggedInUser();
SearchService.ParseResult parseResult = searchService.parseQuery(user, jql == null ? "" : jql);
if (!parseResult.isValid()) {
return false;
}
final MessageSet result = searchService.validateQuery(user, parseResult.getQuery());
if (result.hasAnyErrors()) {
return false;
}
return true;

Suggest an answer

Log in or Sign up to answer