Is it possible to configure a JIRA custom field to show a list of selectable options which are populated by a call to external web service using Scriptrunner? I am basically looking to make a call to a SOA rest api which will return a list for the user to select from. This will then in turn populate my custom field... I am new to Groovy so any examples would be appreciated. Thanks :-)
If I'm understanding you correctly, then I believe you could accomplish this with a Behaviour and a select list conversion. We have some examples and further documentation on the process here.
Let me know if that looks like it'll work for you or if you have any questions! :D
Hi Aidan, thank you for your response...I have tried this script and manipulated it to my URL etc but i am seeing a couple of errors... the first errors tell me that the uri.path, headers and response.failures variables are undeclared... Am i missing part of the script? any guidance appreciated, thanks
Hi Adam, thanks for coming back...
i have been looking at a simpler alternative... is it possible with a behaviour to restrict the values that are allowed in a custom field?
I have a single line text field but i would like to create a behaviour that will restrict what values could be saved in the field and return an error if an incorrect value was input and a save attempted? I was wondering whether i could create a behaviour to do this?>
i am aware that i could create a new field of the select list type but i was hoping i might be able to lock my single line text field down with a behaviour?
You could use a behaviour to do this. Unfortunately populating the list dynamically is not a good fit for behaviours.
If your getting the values from a REST API your really best off using the select list conversions part of behaviours.
If your no longer doing this and have a text field. You can of course check the content using a behaviour and then setting an error if it's not allowed.
There are many examples online and recipes here to get you started.
Hope this helps.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....
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!
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