How can I restrict a list of issues that is returned for issue-picker?

Hello.

I'm developing a custom dialog and I need add an issue picker on it. The list of issues that we can select should contain issues of specified type from a one project. Is there a some way to configure the issue picker to achieve this?

I've found on a default page the following code, is there some attributes that I can use in my case?

<select class="aui-field-issuepicker hidden" multiple="multiple" name="parentIssueKey" id="jira-issue-keys-hidden"
	data-popup-width="620"
	data-popup-height="500"
	data-remove-on-un-select="true"
	data-ajax-options.query="true"
	data-ajax-options.url="/rest/api/1.0/issues/picker" 
	data-ajax-options.data.current-issue-key="$!{action.issueObject.key}"
	data-ajax-options.data.show-sub-tasks="false"
	data-ajax-options.data.show-sub-task-parent="true"
	data-ajax-options.data.app-id="">
</select>

4 answers

1 accepted

1 vote
Timothy Chin Community Champion Mar 31, 2013

Try:

data-ajax-options.url="/rest/api/1.0/issues/picker?query=some_jql_query"

I've tried this, but with no success. I think, this is because JIRA search issues using History Search instead of JQL Search.

I'm having the same problem.

I have created a custom project which holds my vendor contacts (custom issue type I created for contact information).

Now I have added a custom field with the Issue Picker plugin, and would like to restrict the available issues there to my vendor contacts project only.

Has anyone found a solution for this?

After the research, I found out that it is not possible to use JQL at the corresponding ajax-parameter, because JIRA ignores it. Maybe I'm wrong, but I didn't found any way to reuse JIRA REST endpoins, so I implemented my own one.

Actually, REST Browser https://jira.atlassian.com/plugins/servlet/restbrowser#/resource/internal-1-0-issues-pickercould help - actual parameter name is currentJQL (HTML attribute is data-ajax-options.data.current_jql - from linkjiraissue.vm).

The problem is Issue Picker's REST returns two sections - "History Issues", and only after it - "Current Search". If "HI" has more than 8 issues, than "CS" section will be lower, than user's viewport. I didn't find how to disable history search.

"query" param is used to send current user's input, like part of issue key or summary.

Try:

data-ajax-options.data.current-project-id="PROJ"
data-ajax-options.data.current-jql="resolution = Unresolved"

 

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,188 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot