You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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.
Hi @oytun_cayli_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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.