Hello everyone
I want to set parameter to "assignee" into JQL query string.
I tried but there is no result .
Code below that
----------------------------------------------------------------------------------------------
def slYetkilisiCF = customFieldManager.getCustomFieldObject("customfield_15655")/
def slYetkilisiValue = issue.getCustomFieldValue(slYetkilisiCF)
final jqlSearch = 'assignee = '+slYetkilisiValue
def parseResult = searchService.parseQuery(user, jqlSearch)
Query query = parseResult.getQuery();
------------------------------------------------------------------------------------------
When I executed, get output below;
log.debug(query)->{assignee = c0566(JIRAUSER56893)}
Output is wrong query because (JIRAUSER56893) is extra in string.
It should be assignee = c0566
How I pass parameter into JQL query string in script runner?
Thanks for your support.
To add on, what you are passing into the jqlSearch is the ApplicationUser object which gives you: username(userKey)
What you need is just the username which you can get using the method .getName() or .getUsername().
See this API documentation of ApplicationUser for more information.
Moving forward, you can use something like variable.getClass() or slYetkilisiValue.getClass() to check the object type and read on their respective method in their documentation. For example, a String variable will return "class java.lang.String".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi asy@man.eu ,
has your custom field type User Picker (single user)?
If so, please try to do:
final jqlSearch = 'assignee = '+slYetkilisiValue.getName()
I believe slYetkilisiValue is ApplicationUser object, so you need to get name from it.
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.