JIRA call to external web service to return list of values to populate field Edited

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 :-) 

1 answer

Hey Stephen! 

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 Stephen,

I think these are just static type checking errors. Does it work if you save it and run it?


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?

thanks :)

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.


Thanks Adam - I have already been trying to find a similar example on the Scriptrunner site and wider internet but havent come across a specific one that validates the value being input into a field but ill keep digging.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,010 views 4 9
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you