Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,356
Community Members
 
Community Events
168
Community Groups

Query "assignee was currentUser()" doesn't work

In the browser I can query "assignee was currentUser()" and get results just fine, and when my company was using jira server this JQL also worked just fine through the API, but now that we've moved to jira cloud I'm getting an error "A value provided by the function 'currentUser' is invalid for the field 'assignee'."

Looking at the documentation it does indeed say that "=, !=" are the only allowed values. I'm just confused as looking at the old docs it also said "WAS" is not allowed but it worked then, and now it doesn't work through API but does work in the browser.

2 answers

1 accepted

1 vote
Answer accepted

The user had not been assigned to a ticket yet, once I assigned the user to a ticket for the first time the error no longer appears and things work as expected.

Good find!

Hello @Brandon Johnson 

Welcome to the community.

The documentation link you provided is for the Server/Data Center hosted product, and also for Service Management. 

Screen Shot 2022-09-15 at 10.27.42 AM.png

To confirm, are you trying to execute your query against a Service project, or a Software project?

If you are getting the error in an API call can you please provide the full text of the API call and any variables that you are using in it?

Software project. correct software cloud docs are the same. Thank you for showing me my look at older versions was in the wrong place though.

There is no error in the UI

query:

(assignee = currentUser() OR assignee was currentUser()) and project = SR and status not in ("Closed", "Warranty Period") and updated >= currentLogin() ORDER BY key ASC

just for fun I also did it without the first "assignee = currentUser() OR" bit too. This has the same results: UI works fine and API errors with the error

A value provided by the function 'currentUser' is invalid for the field 'assignee'.

Can you please provide the full text of the API call and any variables that you are using in it?

I have not done much work with using the JIRA REST API via python

I found this page which gives an example of an alternate implementation, still using python and the requests library. In this alternate the special characters with the JQL are not encoded. Instead the JQL is just a string enclosed in quotes.

It was a really silly thing, see accepted answer.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS

Atlassian Community Events