Hi,
I've been working on populating a custom field by converting the text box into drop down by referring to
https://scriptrunner.adaptavist.com/4.3.5/jira/behaviours-conversions.html
I was able to narrow down the desired list. However, when I choose the list from the drop down, summary of the selected value is not populated where we could see only the key for the selected value. Eg: If I selected ABC21 - Test from the drop down, then only ABC21 is populated in the custom field. I've been using JQL query to fetch the resultant set in the drop down.
Can anyone help in populating the field along with the summary.
What you are describing is the default behavior using the example in the documentation.
To help you further, it would help to see your exact code.
This is what it looks like in my test:
Hi @Peter-Dave Sheehan ,
Yes, the default behavior displays as you provided in the screenshot. But when I click on update the task number will be updated only as JSP-3. The summary is not updated.
I've used the below code for retrieval of lists.
getFieldByName("ABC").convertToSingleSelect([
ajaxOptions: [
url : getBaseUrl() + "/rest/scriptrunner-jira/latest/issue/picker",
query: true, // keep going back to the sever for each keystroke
// this information is passed to the server with each keystroke
data: [
currentJql : ajaxQueryString + ajaxQueryString2,
label : "Products: "+productNames,
showSubTasks: true,
max : 100,
],
formatResponse: "issue"
],
css: "max-width: 500px; width: 500px",
])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I see. You are right.
The view screen only shows the Issue Key. And when you open the edit screen again, the dropdown shows only the issue key.
This is not surprising because the database only stores the key in that text field.
I think that's how it's designed to work.
You could make a feature request/suggestion with Adaptavist to have that default behavior changed.
The best I can offer as a suggestion is to have a different behavior script that looks for an existing value and then puts the summary for the linked issue in the field's description (below the dropdown).
This won't help with the view screen. The only workaround would be to have a scripted field that loads the linked issue details and display the issue key and summary. You would hide your linked issue field and display this calculated field on the view screen.
I hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Peter-Dave Sheehan ,
Thank you for your suggestion. I've populated both the key and the summary by writing a listener during the updating event to fetch the summary by using the key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.