Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,646,351
Community Members
 
Community Events
196
Community Groups

Scriptrunner Custom Field Issue Template configure fields shown

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

 

1 answer

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:

Screenshot 2022-09-01 at 12.56.28.png

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:

Screenshot 2022-09-01 at 13.03.39.png

Which then shows:

Screenshot 2022-09-01 at 13.03.57.png

Hope this answers your query!

Thanks,

Olly

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events