It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Using currentUser() in JQL functions

Richard Sinden Sep 25, 2017

Hi, 

It would be really useful to be able to write "Assignees (By Roles)" = assignedRole("Developer", currentUser()), rather than assignedRole("Developer", "Richard").

Currently, each user on the team has to create a separate filter to be able to see their own issues, but if we could use currentUser() then we could have a single shared filter. 

This would be especially useful in the quick filters for the agile boards, because only board admins can create the filters.

Thanks,

Richard

2 answers

0 votes
Abhinav Ojha Sep 25, 2017

Hi Richard,

The assignedRole JQL function takes care of this automatically.

If you skip the user key in the function, it takes the current user to search for the issues.

So, "Assignees (By Roles)" = assignedRole("Developer") will infact give you, all the issues where the current user has been assigned to Developer role.

On the other hand, "Assignees (By Roles)" = assignedRole("Richard"), will return issues, where "Richard" has been assigned to any of the roles, and "Assignees (By Roles)" = assignedRole() will return issues, where current user has been assigned to any of the roles.

Let us know if this is helpful.

Thanks,

Abhinav.

Richard Sinden Sep 28, 2017

Hi Abhinav, 

You're right, it does!

In that case, your documentation linked here (https://marketplace.atlassian.com/plugins/com.adweb.estimations.estimationUpdate/server/support) is incorrect. It says using the function like that will "Return issues where any user is assigned to a specific role".

Thanks for the help though, I can achieve what I want with this. 

Best regards,

Richard

Abhinav Ojha Sep 28, 2017

Hi Richard,

Thanks for pointing that one out.

The documentation on the Marketplace is a bit obsolete. As per our development roadmap, we have introduced many new features and have some more lined up ahead. 
Once accomplished, we will be updating the documentation soon incorporating all necessary changes.

Thank You,

Abhinav.

Richard Sinden Oct 03, 2017

Hi Abhinav, 

Actually, I've just been playing with this a bit more, and I would like to create a search that has displays issues assigned to any other user in a specific role. 

In order to do this I would like to right a query like: "Assignees (By Roles)" != assignedRole("Developer", NULL) AND "Assignees (By Roles)" != assignedRole("Developer", currentUser()). 

Is there any way to achieve something like this? 

I also notice that = assignedRole("Developer") returns issues assigned to me, whereas != assignedRole("Developer") returns unassigned issues, which is not the opposite. 

Many thanks,

Richard

0 votes
Ashish Agrawal Dec 12, 2018 • edited

Hi Richard,

Yes, there is a way to get the results who are looking for. You can use a query such as 

Assignees = assignedRole("Developer", "NOASSIGNEE")

You could also combine the above query with a Project in order to see results specific to that project such as 

Project = "Project-Name" and Assignees = assignedRole("Developer", "NOASSIGNEE")

Please install our latest version 1.9.24 of the plugin.

Incase, of any more queries or any assistance please reach out to us on jirasupport@adwebsoftware.com

 Thanks,
Ashish Agrawal

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Marketplace Apps & Integrations

Demo Den Ep. 4: Continuous Integration with CircleCI & Jira Software

Get ready! Demo Den Episode 4 is coming your way on Tuesday, May 28, 2018 with a Continuous Integration and Delivery special demo. CircleCI Director of Solutions Engineering, Eddie Webb will show us ...

697 views 0 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you