Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use issue picker and only show issues within the project selected?

DORIAN KERSCH
Contributor
March 11, 2019

Context:

I am trying to recreate the "Epic Link" or "Component/s" or "Fix Version" like experience on a scripted field.

 

Docs: https://scriptrunner.adaptavist.com/5.5.0/jira/script-fields/issue-picker.html#_usage solves the first part of the experience below but not the second.

 

Experience:

As a user, I want to be able to start typing in something like "Foobar" and a list of issues that have "Foobar" in the text to start showing up in a drop down list (similar to the Epic Link experience and include the "None found" option), so that I can quickly find the issue I am looking for in the project.

As a user, I want to be able to restrict the search in the JQL by the current project (similar to the Component/s Fix Version functionality; most of the JQL search query examples have been "project = XXX"), so that I can only see the relevant issues to the specific project. 

As a user, I want to be able to see the key of the issue I selected in the field, so I know that I selected the correct issue. This would also allow it to show up as a free text searcher and in issue navigator.

 

Things I was thinking of:

project in projectMatch(<issueKey>) but I don't know how to extract that / if that would work. 

 

Semi okay experience:

project in recentProjects()

 

Some other documentation I have been researching:

https://scriptrunner.adaptavist.com/5.4.47/jira/recipes/misc/running-a-jql-query.html

https://scriptrunner.adaptavist.com/5.0.4/jira/scripted-fields.html#_jql_searches_in_script_fields

 

Potentially doing this and the top doc of issue picker may work:

https://community.atlassian.com/t5/Jira-Software-questions/How-to-restrict-a-project-picker-selection-list/qaq-p/799441

 

Does anyone have any suggestions?

 

Edit: Added a mixed solution of using the scripted field and behavior. Is that the best solution?

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Tito Vilchez
October 7, 2019

Hi @Alejandro Suárez García

 

Finally, I solved my issue using Script Runner Escalation and Standard Automation combined. No need to update custom fields via DB updates. Thanks for your interest.

Regards.

0 votes
Alejandro Suárez García
Atlassian Partner
October 7, 2019

Hi @Tito Vilchez 

I strongly not recommend you to update customField values directly in DB. You can use the jira java api to do this with scriptrunner.

This is because the relations in tables that they have internally and the usage of indexing in Jira.

Check the class CustomFieldManager and update your issues with it.

 

Maybe i missread the question here. If thats so, could you explain better what do you want to do?

 

Regards

TAGS
AUG Leaders

Atlassian Community Events