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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,823
Community Members
 
Community Events
184
Community Groups

How do I persist a scriptrunner html field value?

Edited

 

I need a drop down field in a Jira ticket where the values are generated dynamically by shelling out to zookeepercli.

I have a custom scriptrunner field in a Jira project that uses groovy to call zookeepercli, take the results and use them to generate HTML.  The HTML generated is a select tag which displays as a drop down.  The field Template is set to HTML.  The groovy script seems to be working as the HTML is generated with the correct values and renders fine when I go to edit a ticket. 

My problem is that when I select a value from the drop down, it never gets persisted.  There's no way to save.  If I navigate away from the page and come back, the default value is displayed.  

How do I get Jira to store the value selected from my dynamically generated HTML?

When I use the REST API to query for the value of my custom field, I get back the HTML code rather than the value I expect.

Any ideas?

Thanks in advance.

1 answer

1 vote
Steven Behnke
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.
Jan 23, 2018

This will not work. 

Consider a javascript conversion: https://scriptrunner.adaptavist.com/4.3.5/jira/behaviours-conversions.html#_behaviour

Or consider writing a service that syncs Options to a Select dropdown.

Stephen Cheesley _Adaptavist_
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.
Jan 24, 2018

Agree with Steven on this one. I think a behaviour conversion will do the job (I've added a link to the latest version of the documentation)

Thanks for the response!  I'll take a look into behaviour conversion and see if I can wire something up to do what I'm after.  Cursory glance at the docs/examples makes it look like very doable.

Cheers!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events