When the precomputation is sent to an app to evaluate a custom function, will the clientKey or accountId also be provided? The docs refer to the precomputationId in the input but does not refer to anything that would identify the client who made the precomputation request.
JQL Functions docs
I understand that it is not scoped to users as per the docs, however to process the JQL fragment for the response we would need to identify the client who has sent the request.
Hi @JasminBateman, thank you for reaching out!
Itâs important to remember that precomputations are stored in a âglobal contextâ. If two users execute the same query (the same function call), we will utilize the same precomputation. In other words, your app wonât be invoked for the second time.
What does it mean in practice? Letâs imagine you process JQL function logic in the context of the 1st user. The result returned by your function (JQL fragment) is stored as a precomputation and shared by other users who will call this function with the same arguments. This is why we donât pass clientKey
/accountId
within an input object.
If you need to differentiate the behavior of the function based on the user, there is an option to add a dedicated argument, for example:
issue in issuesImportantTo("user-id")
We also describe this here:
https://developer.atlassian.com/cloud/jira/platform/jql-functions/#precomputations-and-users
Best regards,
Ćukasz
2 Likes