Hi,
i have a scriptrunner custom script field which collects some specific Issues and renders them, using the Issue(s) Template.
This is working well and renders the Issuetype Icon, the Issue Key as a Link, the Summary, the Priority Icon and the Status, as expected.
I would like it to also render the resolution. Is this possible to configure somehow?
I am aware, that i could just write custom HTML Code, however that feels not the way to go, when there already exists an Issue renderer.
Thank you very much for your time!
Best Regards,
Florian
Hi Florian,
Olly here from Adaptavist's ScriptRunner Support!
Using the Issue Picker Built-In Scripted Field, we can use one of Adaptavist's examples in our Documentation with some modification to get the 'Resolution'
I've modified the code a little bit for 'Resolution':
import com.atlassian.jira.issue.Issue
import com.onresolve.scriptrunner.canned.util.OutputFormatter
getSearchFields = {
['issuekey', 'summary', 'resolution']
}
renderOptionHtml = { String displayValue, Issue issue, Closure<String> highlight ->
OutputFormatter.markupBuilder {
i('Resolution: ' + issue.resolution?.name)
mkp.yield(' - ')
mkp.yieldUnescaped(displayValue)
}
}
(Please refer to the OutputFormatter Markup Builder docs for further formatting info)
This will return the following:
Do note though that it also returns Issues with no Resolution, i.e. the two Issues I have in the example with null as they haven't been resolved.
To remove these Issues with no resolution, you'd just need to add 'resolution != null' to the JQL query:
Which then shows:
Hope this answers your query!
Thanks,
Olly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.