Hi
I am looking for a way to create custom variable like currentuser() for project.
So we can use same filter across multiple projects.
Variable would be like currentproject()
Is there we can create that?
thanks
Welcome to the Atlassian Community!
currentUser() is a function, and you can create your own functions by writing apps to provide them. https://developer.atlassian.com/server/jira/platform/adding-a-jql-function-to-jira/ is how to do it by hand, but there are a couple of apps in the marketplace that allow you to do it without needing to write your own app (Scriptrunner is the one I use, obviously, as I work for the vendor)
However, you won't be able to write a useful one for "current project". JQL executes outside a project context and your function will always return "none"
Hi @RJ ,
currentuser() is a Jira's built-in JQL function and it is not possible to create currentproject() kinda function because logically it is not possible.
More details for JQL, please refer below link:
https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/
https://scriptrunner.adaptavist.com/latest/jira/tutorials/jql-functions-tutorial.html
If you want to fetch any specific issues from JIRA via JQL, please do let us know.
Hope this will help.
Regards,
Ankit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.