Scripted-field where we can see the JQL-filter`s results

Alexander Bondarev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2019

Hello!

We have a case, need an opportunity to easily get results of dynamic JQL-filter just in issue.

For example, the field where we can see links to unresolved issues of current reporter. 

On my screen - it is "Description".

The field should contain results of JQL-filter or Groovy script that will take values from the tasks, for example, || reporter = "current reporter" and resolution = unresolved ||image.png

The filter will be global for the field, but dynamic - in relation to the values from the issue.

This is just an example for explaining the problem.
The overall goal is to get a tool that allows you to add fields with filter results to issues.

Is it possible to make it using ScriptRunner`s custom fields?

Or maybe you know any another solutions? Maybe plugins?

 

Thanks for help!

3 answers

3 accepted

1 vote
Answer accepted
Bob February 26, 2019

Hi Alexander, 

you can definitely do this with scriptrunner. 

For example, have a look here at Hennings response for JQL in a scriptfield 

https://community.atlassian.com/t5/Jira-questions/Script-Runner-Get-All-Issues-Logged-User-with-Status-quot-in/qaq-p/258287

You can use fields from your issue in the JQL query. 

You can use MarkupBuilder to make it look pretty.

My only issue is what happens when e.g. users add the script field to the issue navigator and the query gets applied to 10's of thousands of issues at the same time...

Alexander Bondarev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2019

Hi! Thank you for answer! 

The guys from the Scriptrunner`s support team helped me to display the results of the JQL-filter in a custom field in a table form.

But I don`t know how using JQL-functions get issues of "reporter of current issue", not "currentUser()"?

The main task - Agent of service desk during processing should see all unresolved tasks from the current reporter - This will help speed up their decision or identify duplicate tasks.

Bob February 27, 2019

Hi Alexander,

You could the reporter of the current issue like so;

def reporter = issue.reporter.getName() 

and then use $reporter in your jql; e.g. "reporter = $reporter AND resolution = empty"

Like Alexander Bondarev likes this
Alexander Bondarev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2019

@Bob , thank you a lot! 

it works!

1 vote
Answer accepted
Andreas Christiansen February 26, 2019

Hi,

it seems the nfeed-Plugin can solve your problem. With nfeed you can query your jira instance based on JQL- and SQL-queries and populate custom fields with the result set.

 

Andreas

Alexander Bondarev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2019

Hi! Thank you for answer! It is really interesting solution! 

The main thing is that this plugin has great potential for use!

0 votes
Answer accepted
Alexander Bondarev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2019

I also found another solution - a free plugin Related Issues, no need in writing scripts - just the JQL and the basic capabilities of the plugin are enough.

Suggest an answer

Log in or Sign up to answer