Hello everybody,
I have an issue picker field in my request form and I would like to run a JQL filter using the reporter chosen in the "Raise this request on behalf of" field.
To do that, I did try to use a behaviour script , looks like this :
def issuePicker = getFieldByName("Order")
issuePicker.setConfigParam('currentJql', 'project = "projectA" and issuetype = "Service Request" and status = "In Progress" and reporter = ????????? )
What do I have to put instead of ???????? to get the reporter name selected in the "Raise this request on behalf of" field ?
Thanks a lot for your help.
@PD Sheehan Thanks for the answer!
I'm now able to gather the reporter name in the reporterName variable (I did verify that in the logs).
But now, how do I have to put this variable in the JQL query ? (reporter = reporterName does'nt work)
def reporterFld = getFIeldById('reporter')
def reporterName = reporterFld.value
def issuePicker = getFieldByName("Order")
issuePicker.setConfigParam('currentJql', 'project = "projectA" and issuetype = "Service Request" and status = "In Progress" and reporter = ?????????')
I'd recommend you become familiar with string management methods in groovy. Here is a good place to start: https://groovy-lang.org/syntax.html#all-strings
But basically, there are many ways to define strings:
Each has they limitations and advantages. The biggest one is the single-quoted strings can't have variable injections. And when you want to use double-quotes inside the string, I often prefer to switch to slashy string so I don't have to escape the double-quotes.
Here is what your JQL would look like:
issuePicker.setConfigParam('currentJql', /project = "projectA" and issuetype = "Service Request" and status = "In Progress" and reporter = $reporterName/)
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.
The "raise issue on behalf of" in the customer portal is really the same as the reporter field in regular jira.
So...
def reporterFld = getFIeldById('reporter')
def reporterName = reporterFld.value
... will get you the username of the reporter and you can use that in your jql.
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.