Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


Scriptrunner custom template issue for picklist

Hi Folks,

I have crated a picklist custom filed with Groovy script by using below custom template, am able to list out all the required values in picklist but not able to save/hold the selected specific value from the list if user perform any operations like page refresh or filling other values picklist displaying default/first value from the list,

Please find the below custom template lnline code 

<select id="Planview Project Name">

May i know how we can save/hold the specific value from the picklist. Thankyou in advance.

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 14, 2022 • edited

Hi @Sreenivas Narala

Could you provide a little more information, i.e. what have you used to configure your picklist? Is it Scripted Fields?

From the code that you have shared, it appears to be more of a javascript.

Could you please share the complete code you are currently using and a screenshot of your configuration so it can be reviewed?

Thank you and Kind regards,


Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

Yes, I have configured Scripted Field with Groovy.

Based on my requirement want to display return values as a picklist/dropdown field and want to save selected value from the list at dashboard/issue creation.

i don't have any issue with source code and facing issue with custom template(picklist/Dropdown).

Below code for Advanced custom template return value(picklist/Dropdown).

<select id="Planview ProjectName">
<option selected disabled>--Select ProjectName--</option>
<span class="overlay-icon throbber"></span>
<div class="save-options" tabindex="1"><button type="submit" class="aui-button submit" accesskey="s" title="Press Alt+s to submit this form" resolved=""><span class="aui-icon aui-icon-small aui-iconfont-success">Save</span></button><button type="cancel" class="aui-button cancel" accesskey="`" title="Press Alt+` to cancel" resolved=""><span class="aui-icon aui-icon-small aui-iconfont-close-dialog">Cancel</span></button></div>


Below is the source code to fetch the data by using API and list out json data by using for loop :-

import com.onresolve.scriptrunner.canned.jira.fields.model.PickerOption
import net.sf.json.groovy.JsonSlurper
import net.sf.json.JSON;
import groovy.json.JsonBuilder
import java.util.TreeSet;

// Source code from below REST API

def get = "".toURL().text
def json = new JsonSlurper().parseText(get)
def Name = json."name"
def result = ""
def sort = new TreeSet();

for (key_value in json) {
def Status_Value = key_value."status"
def BU_Value = key_value."bu"
def ProjectCategory_Value = key_value."projectCategory"

if (!((Status_Value == 'WBS20$CNCL') || (Status_Value == 'WBS20$CLOS') || (ProjectCategory_Value == "MVP Agile") || (BU_Value == "Property & Facilities Solutions")))

for (key_value in sort) {
result = result + "<option>"

return result


Please refer attached screenshots for reference and let me know if anything is neededScriptField_1.pngScriptField_2.pngCurrentOutput.pngExpectedOutput.JPG

AUG Leaders

Atlassian Community Events