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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please provide the full text of the API call and any variables that you are using in it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://dishtech.atlassian.net/rest/api/2/search?jql=%28assignee+%3D+currentUser%28%29+or+assignee+was+currentUser%28%29%29+and+project+%3D+%22Service+Request%22+and+status+not+in+%28%22Closed%22%2C+%22Warranty+Period%22%29+and+updated+%3E%3D+currentLogin%28%29+ORDER+BY+key+ASC&startAt=0&validateQuery=True&maxResults=50
This is the url as a GET request using pythons request library.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.