# Why AbstractJqlFunction.getValues is called twice when there is a project clause?

**URL:** <https://community.developer.atlassian.com/t/why-abstractjqlfunction-getvalues-is-called-twice-when-there-is-a-project-clause/42193>\
**Category:** Jira Server\
**Created:** [October 12, 2020, 6:33pm UTC](https://community.developer.atlassian.com/t/why-abstractjqlfunction-getvalues-is-called-twice-when-there-is-a-project-clause/42193 "2020-10-12T18:33:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RicardoHerrera](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@RicardoHerrera](https://community.developer.atlassian.com/u/RicardoHerrera)\
**Post date:** [October 12, 2020, 6:33pm UTC](https://community.developer.atlassian.com/t/why-abstractjqlfunction-getvalues-is-called-twice-when-there-is-a-project-clause/42193/1 "2020-10-12T18:33:04Z")

</div>

Hi community, I’m writing a plugin that defines a JQL function but I’ve observed that the AbstractJqlFunction.getValues method is called twice when I include a project clause (besides my terminalClause), and what is more strange is that it is called once without the project clause (determinedProjects set is empty) and the second one is called with determinedProjects filled properly. Any idea of why this occurs this way? This topic had been asked before in the regular Atlassian community without a response:

> **[why jql functions call getvalues() before validate() and getvalues() called...](https://community.atlassian.com/t5/Jira-questions/why-jql-functions-call-getvalues-before-validate-and-getvalues/qaq-p/747895#U1504283)**
>
> Testcase key documantation remain   public List getValues(QueryCreationContext queryCreationContext, FunctionOperand operand, TerminalClause terminalClause) { //First execution comes here....

and

> **[Why Jira JQL function getValues is called twice?](https://community.atlassian.com/t5/Answers-Developer-Questions/Why-Jira-JQL-function-getValues-is-called-twice/qaq-p/555163)**
>
> I have develped a JQL function by extending AbstractJqlFunction and implementing the validate and getValues methods. During testing I have noticed that the getValues method is called twice when I click on the search icon or press enter on advanced...

Issue is replicable on both Jira Server 7 and 8.
